#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 {
struct NumberContext { … };
struct NumberTest { … };
}
class PhoneNumberMatcherTest : public testing::Test { … };
TEST_F(PhoneNumberMatcherTest, ContainsMoreThanOneSlashInNationalNumber) { … }
TEST_F(PhoneNumberMatcherTest, FindNationalNumber) { … }
TEST_F(PhoneNumberMatcherTest, FindWithInternationalPrefixes) { … }
TEST_F(PhoneNumberMatcherTest, FindWithLeadingZero) { … }
TEST_F(PhoneNumberMatcherTest, FindNationalNumberArgentina) { … }
TEST_F(PhoneNumberMatcherTest, FindWithXInNumber) { … }
TEST_F(PhoneNumberMatcherTest, FindNumbersMexico) { … }
TEST_F(PhoneNumberMatcherTest, FindNumbersWithPlusWithNoRegion) { … }
TEST_F(PhoneNumberMatcherTest, FindExtensions) { … }
TEST_F(PhoneNumberMatcherTest, FindInterspersedWithSpace) { … }
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) { … }
static const NumberTest kImpossibleCases[] = …;
static const NumberTest kPossibleOnlyCases[] = …;
static const NumberTest kValidCases[] = …;
static const NumberTest kStrictGroupingCases[] = …;
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) { … }
}
}