chromium/third_party/libphonenumber/dist/cpp/test/phonenumbers/phonenumbermatcher_test.cc

// Copyright (C) 2011 The Libphonenumber Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "phonenumbers/phonenumbermatcher.h"

#include <string>
#include <vector>

#include <gtest/gtest.h>
#include <unicode/unistr.h>

#include "phonenumbers/base/basictypes.h"
#include "phonenumbers/base/memory/scoped_ptr.h"
#include "phonenumbers/base/memory/singleton.h"
#include "phonenumbers/default_logger.h"
#include "phonenumbers/phonenumber.h"
#include "phonenumbers/phonenumber.pb.h"
#include "phonenumbers/phonenumbermatch.h"
#include "phonenumbers/phonenumberutil.h"
#include "phonenumbers/stringutil.h"
#include "phonenumbers/test_util.h"

namespace i18n {
namespace phonenumbers {

string;
UnicodeString;

namespace {
// Small class that holds the context of the number we are testing against. The
// test will insert the phone number to be found between leading_text and
// trailing_text.
struct NumberContext {};

// Small class that holds the number we want to test and the region for which it
// should be valid.
struct NumberTest {};
}  // namespace

class PhoneNumberMatcherTest : public testing::Test {};

TEST_F(PhoneNumberMatcherTest, ContainsMoreThanOneSlashInNationalNumber) {}

// See PhoneNumberUtilTest::ParseNationalNumber.
TEST_F(PhoneNumberMatcherTest, FindNationalNumber) {}

// See PhoneNumberUtilTest::ParseWithInternationalPrefixes.
TEST_F(PhoneNumberMatcherTest, FindWithInternationalPrefixes) {}

// See PhoneNumberUtilTest::ParseWithLeadingZero.
TEST_F(PhoneNumberMatcherTest, FindWithLeadingZero) {}

// See PhoneNumberUtilTest::ParseNationalNumberArgentina.
TEST_F(PhoneNumberMatcherTest, FindNationalNumberArgentina) {}

// See PhoneNumberMatcherTest::ParseWithXInNumber.
TEST_F(PhoneNumberMatcherTest, FindWithXInNumber) {}

// See PhoneNumberUtilTest::ParseNumbersMexico.
TEST_F(PhoneNumberMatcherTest, FindNumbersMexico) {}

// See PhoneNumberUtilTest::ParseNumbersWithPlusWithNoRegion.
TEST_F(PhoneNumberMatcherTest, FindNumbersWithPlusWithNoRegion) {}

// See PhoneNumberUtilTest::ParseExtensions.
TEST_F(PhoneNumberMatcherTest, FindExtensions) {}

TEST_F(PhoneNumberMatcherTest, FindInterspersedWithSpace) {}

// Test matching behavior when starting in the middle of a phone number.
TEST_F(PhoneNumberMatcherTest, IntermediateParsePositions) {}

TEST_F(PhoneNumberMatcherTest, FourMatchesInARow) {}

TEST_F(PhoneNumberMatcherTest, MatchesFoundWithMultipleSpaces) {}

TEST_F(PhoneNumberMatcherTest, MatchWithSurroundingZipcodes) {}

TEST_F(PhoneNumberMatcherTest, IsLatinLetter) {}

TEST_F(PhoneNumberMatcherTest, MatchesWithSurroundingLatinChars) {}

TEST_F(PhoneNumberMatcherTest, MoneyNotSeenAsPhoneNumber) {}

TEST_F(PhoneNumberMatcherTest, PercentageNotSeenAsPhoneNumber) {}

TEST_F(PhoneNumberMatcherTest, PhoneNumberWithLeadingOrTrailingMoneyMatches) {}

TEST_F(PhoneNumberMatcherTest,
       MatchesWithSurroundingLatinCharsAndLeadingPunctuation) {}

TEST_F(PhoneNumberMatcherTest, MatchesWithSurroundingChineseChars) {}

TEST_F(PhoneNumberMatcherTest, MatchesWithSurroundingPunctuation) {}

TEST_F(PhoneNumberMatcherTest,
       MatchesMultiplePhoneNumbersSeparatedByPhoneNumberPunctuation) {}

TEST_F(PhoneNumberMatcherTest,
       DoesNotMatchMultiplePhoneNumbersSeparatedWithNoWhiteSpace) {}

// Strings with number-like things that shouldn't be found under any level.
static const NumberTest kImpossibleCases[] =;

// Strings with number-like things that should only be found under "possible".
static const NumberTest kPossibleOnlyCases[] =;

// Strings with number-like things that should only be found up to and including
// the "valid" leniency level.
static const NumberTest kValidCases[] =;

// Strings with number-like things that should only be found up to and including
// the "strict_grouping" leniency level.
static const NumberTest kStrictGroupingCases[] =;

// Strings with number-like things that should be found at all levels.
static const NumberTest kExactGroupingCases[] =;

TEST_F(PhoneNumberMatcherTest, MatchesWithPossibleLeniency) {}

TEST_F(PhoneNumberMatcherTest, NonMatchesWithPossibleLeniency) {}

TEST_F(PhoneNumberMatcherTest, MatchesWithValidLeniency) {}

TEST_F(PhoneNumberMatcherTest, NonMatchesWithValidLeniency) {}

TEST_F(PhoneNumberMatcherTest, MatchesWithStrictGroupingLeniency) {}

TEST_F(PhoneNumberMatcherTest, NonMatchesWithStrictGroupingLeniency) {}

TEST_F(PhoneNumberMatcherTest, MatchesWithExactGroupingLeniency) {}

TEST_F(PhoneNumberMatcherTest, NonMatchesWithExactGroupingLeniency) {}

TEST_F(PhoneNumberMatcherTest, ExtractMatchIgnoresAmericanDates) {}

TEST_F(PhoneNumberMatcherTest, NonMatchingBracketsAreInvalid) {}

TEST_F(PhoneNumberMatcherTest, NoMatchIfRegionIsUnknown) {}

TEST_F(PhoneNumberMatcherTest, NoMatchInEmptyString) {}

TEST_F(PhoneNumberMatcherTest, NoMatchIfNoNumber) {}

TEST_F(PhoneNumberMatcherTest, NoErrorWithSpecialCharacters) {}

TEST_F(PhoneNumberMatcherTest, Sequences) {}

TEST_F(PhoneNumberMatcherTest, MaxMatches) {}

TEST_F(PhoneNumberMatcherTest, MaxMatchesInvalid) {}

TEST_F(PhoneNumberMatcherTest, MaxMatchesMixed) {}

TEST_F(PhoneNumberMatcherTest, NonPlusPrefixedNumbersNotFoundForInvalidRegion) {}

TEST_F(PhoneNumberMatcherTest, EmptyIteration) {}

TEST_F(PhoneNumberMatcherTest, SingleIteration) {}

TEST_F(PhoneNumberMatcherTest, SingleIteration_WithNextOnly) {}

TEST_F(PhoneNumberMatcherTest, DoubleIteration) {}

TEST_F(PhoneNumberMatcherTest, DoubleIteration_WithNextOnly) {}

}  // namespace phonenumbers
}  // namespace i18n