summaryrefslogtreecommitdiff
path: root/tests/src/com/android/dialer/dialpad/SmartDialNameMatcherTest.java
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2013-04-30 17:49:03 -0700
committerYorke Lee <yorkelee@google.com>2013-05-01 13:41:22 -0700
commit006d071bd477768b4685385d15b3385f6d2e834d (patch)
tree864213e1c7f10a01e07c8108365684811790640d /tests/src/com/android/dialer/dialpad/SmartDialNameMatcherTest.java
parentec2a6103d517a1896abffc493e5f883049872ca9 (diff)
Apply NANP logic to numbers with a +1 country code
Bug 8769688 Change-Id: I4aadd0f9e5495fb1b604910306dfd918d1540136
Diffstat (limited to 'tests/src/com/android/dialer/dialpad/SmartDialNameMatcherTest.java')
-rw-r--r--tests/src/com/android/dialer/dialpad/SmartDialNameMatcherTest.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/src/com/android/dialer/dialpad/SmartDialNameMatcherTest.java b/tests/src/com/android/dialer/dialpad/SmartDialNameMatcherTest.java
index 83b856059..eb6f05087 100644
--- a/tests/src/com/android/dialer/dialpad/SmartDialNameMatcherTest.java
+++ b/tests/src/com/android/dialer/dialpad/SmartDialNameMatcherTest.java
@@ -201,6 +201,17 @@ public class SmartDialNameMatcherTest extends TestCase {
checkMatchesNumber("1-510-333-7596", "5103337596", true, true, 2, 14);
checkMatchesNumber("1-510-333-7596", "3337596", true, true, 6, 14);
+ // An 11 digit number prefixed with +1 should be matched by the 10 digit number, as well as
+ // the 7 digit number (without area code)
+ checkMatchesNumber("+1-510-333-7596", "5103337596", true, true, 3, 15);
+ checkMatchesNumber("+1-510-333-7596", "3337596", true, true, 7, 15);
+ checkMatchesNumber("+1-510-333-7596", "103337596", false, true, 0, 0);
+ checkMatchesNumber("+1-510-333-7596", "337596", false, true, 0, 0);
+ checkMatchesNumber("+1510 3337596", "5103337596", true, true, 2, 13);
+ checkMatchesNumber("+1510 3337596", "3337596", true, true, 6, 13);
+ checkMatchesNumber("+1510 3337596", "103337596", false, true, 0, 0);
+ checkMatchesNumber("+1510 3337596", "37596", false, true, 0, 0);
+
// Invalid NANP numbers should not be matched
checkMatchesNumber("1-510-333-759", "510333759", false, true, 0, 0);
checkMatchesNumber("510-333-759", "333759", false, true, 0, 0);