-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix regex matching in GetLengthOfNationalDestinationCode #150
Fix regex matching in GetLengthOfNationalDestinationCode #150
Conversation
Different to the regex in JAVA implementation.
phonenumbers_test.go
Outdated
@@ -822,13 +822,13 @@ func TestGetLengthOfGeographicalAreaCode(t *testing.T) { | |||
numName string | |||
length int | |||
}{ | |||
{numName: "US_NUMBER", length: 3}, | |||
{numName: "US_NUMBER", length: 1}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this wrong now... US area codes are 3 digits, UK are 2 etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that seems definitely wrong, let me investigate it and compare with the Java version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, found the issue comparing the whole method -reverted my unit test changes and updated the method to match the latest JAVA version of the library.
This reverts commit 12fc128.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #150 +/- ##
=======================================
Coverage 49.66% 49.66%
=======================================
Files 9 9
Lines 3304 3304
=======================================
Hits 1641 1641
Misses 1521 1521
Partials 142 142 ☔ View full report in Codecov by Sentry. |
Different to the regex in JAVA implementation.
Refer to issue #147