diff options
author | Daisuke Miyakawa <dmiyakawa@google.com> | 2009-09-01 22:07:18 +0900 |
---|---|---|
committer | Daisuke Miyakawa <dmiyakawa@google.com> | 2009-09-02 07:44:17 +0900 |
commit | b3b8a9dac508afdbac8de93a31a752c60e34e254 (patch) | |
tree | eabb7eb8900b6404a62ddbd6bd52d04d6777a5db /android/PhoneNumberUtilsTest.cpp | |
parent | db6e3c88e800f912f6b5709733fc477ff6e0c55d (diff) |
Fix the implementation of phone_number_compare in accordance with the tests in PhoneNumberUtils.java.
Due to the Thailand's special case, the code became a little nastier than before, but I believe it is inevitable...
Diffstat (limited to 'android/PhoneNumberUtilsTest.cpp')
-rw-r--r-- | android/PhoneNumberUtilsTest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/android/PhoneNumberUtilsTest.cpp b/android/PhoneNumberUtilsTest.cpp index a33f10a..4d9809d 100644 --- a/android/PhoneNumberUtilsTest.cpp +++ b/android/PhoneNumberUtilsTest.cpp @@ -82,6 +82,7 @@ int main() { EXPECT_EQ("650-253-0000", " 1-650-253-0000"); EXPECT_NE("650-253-0000", "11-650-253-0000"); EXPECT_NE("650-253-0000", "0-650-253-0000"); + EXPECT_EQ("555-4141", "+1-700-555-4141"); EXPECT_EQ("+1 650-253-0000", "6502530000"); EXPECT_EQ("001 650-253-0000", "6502530000"); @@ -124,6 +125,10 @@ int main() { // Confirm that the bug found before does not re-appear. EXPECT_NE("080-1234-5678", "+819012345678"); EXPECT_EQ("650-000-3456", "16500003456"); + EXPECT_EQ("011 1 7005554141", "+17005554141"); + EXPECT_NE("011 11 7005554141", "+17005554141"); + EXPECT_NE("+44 207 792 3490", "00 207 792 3490"); + // This is not related to Thailand case. NAMP "1" + region code "661". EXPECT_EQ("16610001234", "6610001234"); // We also need to compare two alpha addresses to make sure two different strings |