summaryrefslogtreecommitdiffstats
path: root/telephony/tests
diff options
context:
space:
mode:
authorShaopeng Jia <shaopengjia@google.com>2011-11-04 17:39:10 +0100
committerShaopeng Jia <shaopengjia@google.com>2011-11-07 11:30:14 +0100
commit21aff6bd90399220a0c77d416dd7c0d025621aac (patch)
tree9cf6d484527ec0b576c3ff5c3906190d780fc085 /telephony/tests
parent3fb5048b02b01b6f5edc517ad5fb8aec79b67751 (diff)
downloadframeworks_base-21aff6bd90399220a0c77d416dd7c0d025621aac.zip
frameworks_base-21aff6bd90399220a0c77d416dd7c0d025621aac.tar.gz
frameworks_base-21aff6bd90399220a0c77d416dd7c0d025621aac.tar.bz2
Adding two tests to ensure formatNumber is working correctly with
Polish numbers, both valid and invalid. Change-Id: I5f3bfc34cd5b88526853c0da0aa299a77e8f1901
Diffstat (limited to 'telephony/tests')
-rw-r--r--telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberUtilsTest.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberUtilsTest.java b/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberUtilsTest.java
index e2349af..1a3e487 100644
--- a/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberUtilsTest.java
+++ b/telephony/tests/telephonytests/src/com/android/internal/telephony/PhoneNumberUtilsTest.java
@@ -547,6 +547,11 @@ public class PhoneNumberUtilsTest extends AndroidTestCase {
assertEquals("+1 650-291-0000", PhoneNumberUtils.formatNumber("+16502910000", null, "CN"));
// The given number was formatted.
assertEquals("650-291-0000", PhoneNumberUtils.formatNumber("650-291-0000", null, "US"));
+ // A valid Polish number should be formatted.
+ assertEquals("506 128 687", PhoneNumberUtils.formatNumber("506128687", null, "PL"));
+ // An invalid Polish number should be left as it is. Note Poland doesn't use '0' as a
+ // national prefix; therefore, the leading '0' makes the number invalid.
+ assertEquals("0506128687", PhoneNumberUtils.formatNumber("0506128687", null, "PL"));
}
@SmallTest
public void testIsEmergencyNumber() {