Skip to content
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

Stub Countries Consider CC-only Number Valid #40

Closed
theory opened this issue Jul 13, 2015 · 2 comments
Closed

Stub Countries Consider CC-only Number Valid #40

theory opened this issue Jul 13, 2015 · 2 comments

Comments

@theory
Copy link
Contributor

theory commented Jul 13, 2015

This test fails:

--- a/t/42-libphonenumber.t
+++ b/t/42-libphonenumber.t
@@ -51,4 +51,7 @@ is($je->country_code(), 44, "$CLASS->new('$ukje')->country_code()");
 is($je->country(), 'JE', "$CLASS->new('$ukje')->country()");
 is($je->format(), '+44 1534 556291', "$CLASS->new('$ukje')->format()");

+# Country code only.
+is $CLASS->new('+7'), undef, 'Should get no object for +7';
+
 done_testing;

I really don't think "+7" should be considered a valid country. We have quite a few number records in our system like this, now:

+7
+56
+52
+62
+44
+66
+54
+36
+57
+45
+64
+32
+30
+46
+20
+63
+33
+86
+31
+44 1
+354
+386
+356
+231
+262
+358
+389
+229
+355
+375
+385
+211
+265
+995
+352
+350

I'm assuming there's a wayward ? in the validator regular expressions somewhere…

@DrHyde
Copy link
Owner

DrHyde commented Jul 18, 2015

This seems to affect any country where google's data doesn't have all three of the types that I smoosh together into "special rate" - that is, shared code, premium rate, and UAN. It also affects "country" codes for which I don't have stub classes at all such as Inmarsat.

Fixed in 3.0009, which is on its way to the CPAN now.

@DrHyde DrHyde closed this as completed Jul 18, 2015
@theory
Copy link
Contributor Author

theory commented Jul 18, 2015

Thanks, @DrHyde.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants