Browse Source

Passing first unit test

pull/2107/head
David Humphrey 8 years ago
parent
commit
b84fe43c8f
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      javascript/i18n/phonenumbers/phonenumbermatcher.js
  2. +1
    -1
      javascript/i18n/phonenumbers/phonenumbermatcher_test.js

+ 1
- 1
javascript/i18n/phonenumbers/phonenumbermatcher.js View File

@ -218,7 +218,7 @@ var LEAD_CLASS; // built dynamically below
function trimAfterFirstMatch(pattern, candidate) {
var trailingCharsMatcher = pattern.exec(candidate);
if (trailingCharsMatcher && trailingCharsMatcher.length) {
candidate = candidate.substring(0, trailingCharsMatcher[0].index);
candidate = candidate.substring(0, trailingCharsMatcher.index);
}
return candidate;
}


+ 1
- 1
javascript/i18n/phonenumbers/phonenumbermatcher_test.js View File

@ -54,7 +54,7 @@ function doTestFindInContext(number, defaultCountry) {
function assertMatchProperties(match, text, number, region) {
var expectedResult = phoneUtil.parse(number, region);
assertNotNull("Did not find a number in '" + text + "'; expected " + number, match);
assertEquals(expectedResult, match.number);
assertTrue(expectedResult.equals(match.number));
assertEquals(number, match.rawString);
}


Loading…
Cancel
Save