#include "phonenumbers/phonenumberutil.h"
#include <algorithm>
#include <iostream>
#include <list>
#include <set>
#include <string>
#include <gtest/gtest.h>
#include <unicode/uchar.h>
#include "phonenumbers/default_logger.h"
#include "phonenumbers/normalize_utf8.h"
#include "phonenumbers/phonemetadata.pb.h"
#include "phonenumbers/phonenumber.h"
#include "phonenumbers/phonenumber.pb.h"
#include "phonenumbers/test_util.h"
namespace i18n {
namespace phonenumbers {
find;
ostream;
RepeatedPtrField;
static const int kInvalidCountryCode = …;
class PhoneNumberUtilTest : public testing::Test { … };
TEST_F(PhoneNumberUtilTest, ContainsOnlyValidDigits) { … }
TEST_F(PhoneNumberUtilTest, InterchangeInvalidCodepoints) { … }
TEST_F(PhoneNumberUtilTest, GetSupportedRegions) { … }
TEST_F(PhoneNumberUtilTest, GetSupportedGlobalNetworkCallingCodes) { … }
TEST_F(PhoneNumberUtilTest, GetSupportedCallingCodes) { … }
TEST_F(PhoneNumberUtilTest, GetSupportedTypesForRegion) { … }
TEST_F(PhoneNumberUtilTest, GetSupportedTypesForNonGeoEntity) { … }
TEST_F(PhoneNumberUtilTest, GetRegionCodesForCountryCallingCode) { … }
TEST_F(PhoneNumberUtilTest, GetInstanceLoadUSMetadata) { … }
TEST_F(PhoneNumberUtilTest, GetInstanceLoadDEMetadata) { … }
TEST_F(PhoneNumberUtilTest, GetInstanceLoadARMetadata) { … }
TEST_F(PhoneNumberUtilTest, GetInstanceLoadInternationalTollFreeMetadata) { … }
TEST_F(PhoneNumberUtilTest, GetNationalSignificantNumber) { … }
TEST_F(PhoneNumberUtilTest, GetNationalSignificantNumber_ManyLeadingZeros) { … }
TEST_F(PhoneNumberUtilTest, GetExampleNumber) { … }
TEST_F(PhoneNumberUtilTest, GetInvalidExampleNumber) { … }
TEST_F(PhoneNumberUtilTest, GetExampleNumberForNonGeoEntity) { … }
TEST_F(PhoneNumberUtilTest, GetExampleNumberWithoutRegion) { … }
TEST_F(PhoneNumberUtilTest, FormatUSNumber) { … }
TEST_F(PhoneNumberUtilTest, FormatBSNumber) { … }
TEST_F(PhoneNumberUtilTest, FormatGBNumber) { … }
TEST_F(PhoneNumberUtilTest, FormatDENumber) { … }
TEST_F(PhoneNumberUtilTest, FormatITNumber) { … }
TEST_F(PhoneNumberUtilTest, FormatAUNumber) { … }
TEST_F(PhoneNumberUtilTest, FormatARNumber) { … }
TEST_F(PhoneNumberUtilTest, FormatMXNumber) { … }
TEST_F(PhoneNumberUtilTest, FormatOutOfCountryCallingNumber) { … }
TEST_F(PhoneNumberUtilTest, FormatOutOfCountryWithInvalidRegion) { … }
TEST_F(PhoneNumberUtilTest, FormatOutOfCountryWithPreferredIntlPrefix) { … }
TEST_F(PhoneNumberUtilTest, FormatOutOfCountryKeepingAlphaChars) { … }
TEST_F(PhoneNumberUtilTest, FormatWithCarrierCode) { … }
TEST_F(PhoneNumberUtilTest, FormatWithPreferredCarrierCode) { … }
TEST_F(PhoneNumberUtilTest, FormatNumberForMobileDialing) { … }
TEST_F(PhoneNumberUtilTest, FormatByPattern) { … }
TEST_F(PhoneNumberUtilTest, FormatE164Number) { … }
TEST_F(PhoneNumberUtilTest, FormatNumberWithExtension) { … }
TEST_F(PhoneNumberUtilTest, GetLengthOfGeographicalAreaCode) { … }
TEST_F(PhoneNumberUtilTest, GetLengthOfNationalDestinationCode) { … }
TEST_F(PhoneNumberUtilTest, GetCountryMobileToken) { … }
TEST_F(PhoneNumberUtilTest, ExtractPossibleNumber) { … }
TEST_F(PhoneNumberUtilTest, IsNANPACountry) { … }
TEST_F(PhoneNumberUtilTest, IsValidNumber) { … }
TEST_F(PhoneNumberUtilTest, IsValidForRegion) { … }
TEST_F(PhoneNumberUtilTest, IsNotValidNumber) { … }
TEST_F(PhoneNumberUtilTest, GetRegionCodeForCountryCode) { … }
TEST_F(PhoneNumberUtilTest, GetRegionCodeForNumber) { … }
TEST_F(PhoneNumberUtilTest, IsPossibleNumber) { … }
TEST_F(PhoneNumberUtilTest, IsPossibleNumberForType_DifferentTypeLengths) { … }
TEST_F(PhoneNumberUtilTest, IsPossibleNumberForType_LocalOnly) { … }
TEST_F(PhoneNumberUtilTest, IsPossibleNumberForType_DataMissingForSizeReasons) { … }
TEST_F(PhoneNumberUtilTest,
IsPossibleNumberForType_NumberTypeNotSupportedForRegion) { … }
TEST_F(PhoneNumberUtilTest, IsPossibleNumberWithReason) { … }
TEST_F(PhoneNumberUtilTest,
IsPossibleNumberForTypeWithReason_DifferentTypeLengths) { … }
TEST_F(PhoneNumberUtilTest, IsPossibleNumberForTypeWithReason_LocalOnly) { … }
TEST_F(PhoneNumberUtilTest,
IsPossibleNumberForTypeWithReason_DataMissingForSizeReasons) { … }
TEST_F(PhoneNumberUtilTest,
IsPossibleNumberForTypeWithReason_NumberTypeNotSupportedForRegion) { … }
TEST_F(PhoneNumberUtilTest,
IsPossibleNumberForTypeWithReason_FixedLineOrMobile) { … }
TEST_F(PhoneNumberUtilTest, IsNotPossibleNumber) { … }
TEST_F(PhoneNumberUtilTest, TruncateTooLongNumber) { … }
TEST_F(PhoneNumberUtilTest, IsNumberGeographical) { … }
TEST_F(PhoneNumberUtilTest, FormatInOriginalFormat) { … }
TEST_F(PhoneNumberUtilTest, IsPremiumRate) { … }
TEST_F(PhoneNumberUtilTest, IsTollFree) { … }
TEST_F(PhoneNumberUtilTest, IsMobile) { … }
TEST_F(PhoneNumberUtilTest, IsFixedLine) { … }
TEST_F(PhoneNumberUtilTest, IsFixedLineAndMobile) { … }
TEST_F(PhoneNumberUtilTest, IsSharedCost) { … }
TEST_F(PhoneNumberUtilTest, IsVoip) { … }
TEST_F(PhoneNumberUtilTest, IsPersonalNumber) { … }
TEST_F(PhoneNumberUtilTest, IsUnknown) { … }
TEST_F(PhoneNumberUtilTest, GetCountryCodeForRegion) { … }
TEST_F(PhoneNumberUtilTest, GetNationalDiallingPrefixForRegion) { … }
TEST_F(PhoneNumberUtilTest, IsViablePhoneNumber) { … }
TEST_F(PhoneNumberUtilTest, IsViablePhoneNumberNonAscii) { … }
TEST_F(PhoneNumberUtilTest, ConvertAlphaCharactersInNumber) { … }
TEST_F(PhoneNumberUtilTest, NormaliseRemovePunctuation) { … }
TEST_F(PhoneNumberUtilTest, NormaliseReplaceAlphaCharacters) { … }
TEST_F(PhoneNumberUtilTest, NormaliseOtherDigits) { … }
TEST_F(PhoneNumberUtilTest, NormaliseStripAlphaCharacters) { … }
TEST_F(PhoneNumberUtilTest, NormaliseStripNonDiallableCharacters) { … }
TEST_F(PhoneNumberUtilTest, MaybeStripInternationalPrefix) { … }
TEST_F(PhoneNumberUtilTest, MaybeStripNationalPrefixAndCarrierCode) { … }
TEST_F(PhoneNumberUtilTest, MaybeStripExtension) { … }
TEST_F(PhoneNumberUtilTest, MaybeExtractCountryCode) { … }
TEST_F(PhoneNumberUtilTest, CountryWithNoNumberDesc) { … }
TEST_F(PhoneNumberUtilTest, UnknownCountryCallingCode) { … }
TEST_F(PhoneNumberUtilTest, IsNumberMatchMatches) { … }
TEST_F(PhoneNumberUtilTest, IsNumberMatchShortMatchIfDiffNumLeadingZeros) { … }
TEST_F(PhoneNumberUtilTest, IsNumberMatchAcceptsProtoDefaultsAsMatch) { … }
TEST_F(PhoneNumberUtilTest,
IsNumberMatchMatchesDiffLeadingZerosIfItalianLeadingZeroFalse) { … }
TEST_F(PhoneNumberUtilTest, IsNumberMatchIgnoresSomeFields) { … }
TEST_F(PhoneNumberUtilTest, IsNumberMatchNonMatches) { … }
TEST_F(PhoneNumberUtilTest, IsNumberMatchNsnMatches) { … }
TEST_F(PhoneNumberUtilTest, IsNumberMatchShortNsnMatches) { … }
TEST_F(PhoneNumberUtilTest, ParseNationalNumber) { … }
TEST_F(PhoneNumberUtilTest, ParseNumberWithAlphaCharacters) { … }
TEST_F(PhoneNumberUtilTest, ParseWithInternationalPrefixes) { … }
TEST_F(PhoneNumberUtilTest, ParseWithLeadingZero) { … }
TEST_F(PhoneNumberUtilTest, ParseNationalNumberArgentina) { … }
TEST_F(PhoneNumberUtilTest, ParseWithXInNumber) { … }
TEST_F(PhoneNumberUtilTest, ParseNumbersMexico) { … }
TEST_F(PhoneNumberUtilTest, FailedParseOnInvalidNumbers) { … }
TEST_F(PhoneNumberUtilTest, ParseNumbersWithPlusWithNoRegion) { … }
TEST_F(PhoneNumberUtilTest, ParseNumberTooShortIfNationalPrefixStripped) { … }
TEST_F(PhoneNumberUtilTest, ParseExtensions) { … }
TEST_F(PhoneNumberUtilTest, TestParseHandlesLongExtensionsWithExplicitLabels) { … }
TEST_F(PhoneNumberUtilTest,
TestParseHandlesLongExtensionsWithAutoDiallingLabels) { … }
TEST_F(PhoneNumberUtilTest, TestParseHandlesShortExtensionsWithAmbiguousChar) { … }
TEST_F(PhoneNumberUtilTest, TestParseHandlesShortExtensionsWhenNotSureOfLabel) { … }
TEST_F(PhoneNumberUtilTest, ParseAndKeepRaw) { … }
TEST_F(PhoneNumberUtilTest, ParseItalianLeadingZeros) { … }
TEST_F(PhoneNumberUtilTest, CanBeInternationallyDialled) { … }
TEST_F(PhoneNumberUtilTest, IsAlphaNumber) { … }
}
}