Browse Source

Merge pull request #1014 from googlei18n/ifdef_phonenumbertests_alt_format

Adding ifdef I18N_PHONENUMBERS_USE_ALTERNATE_FORMATS in phonenumbermatcher_test
pull/989/merge
Andy Staudacher 10 years ago
parent
commit
bf6dfbba37
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      cpp/test/phonenumbers/phonenumbermatcher_test.cc

+ 9
- 1
cpp/test/phonenumbers/phonenumbermatcher_test.cc View File

@ -864,11 +864,15 @@ static const NumberTest kStrictGroupingCases[] = {
// Should be found by strict grouping but not exact grouping, as the last two
// groups are formatted together as a block.
NumberTest("0800-2491234", RegionCode::DE()),
// If the user is using alternate formats, test that numbers formatted in
// that way are found.
#ifdef I18N_PHONENUMBERS_USE_ALTERNATE_FORMATS
// Doesn't match any formatting in the test file, but almost matches an
// alternate format (the last two groups have been squashed together here).
NumberTest("0900-1 123123", RegionCode::DE()),
NumberTest("(0)900-1 123123", RegionCode::DE()),
NumberTest("0 900-1 123123", RegionCode::DE()),
#endif // I18N_PHONENUMBERS_USE_ALTERNATE_FORMATS
// NDC also found as part of the country calling code; this shouldn't ruin the
// grouping expectations.
NumberTest("+33 3 34 2312", RegionCode::FR()),
@ -903,13 +907,17 @@ static const NumberTest kExactGroupingCases[] = {
NumberTest("0494949 ext. 49", RegionCode::DE()),
NumberTest("01 (33) 3461 2234", RegionCode::MX()), // Optional NP present
NumberTest("(33) 3461 2234", RegionCode::MX()), // Optional NP omitted
// Breakdown assistance number with normal formatting.
// If the user is using alternate formats, test that numbers formatted in
// that way are found.
#ifdef I18N_PHONENUMBERS_USE_ALTERNATE_FORMATS
// Breakdown assistance number using alternate formatting pattern.
NumberTest("1800-10-10 22", RegionCode::AU()),
// Doesn't match any formatting in the test file, but matches an alternate
// format exactly.
NumberTest("0900-1 123 123", RegionCode::DE()),
NumberTest("(0)900-1 123 123", RegionCode::DE()),
NumberTest("0 900-1 123 123", RegionCode::DE()),
#endif // I18N_PHONENUMBERS_USE_ALTERNATE_FORMATS
NumberTest("+33 3 34 23 12", RegionCode::FR()),
};


Loading…
Cancel
Save