Improve e164 normalization check by re-parsing without country code

This commit is contained in:
Chris Eager
2022-08-10 12:24:01 -05:00
committed by Chris Eager
parent 6d0345d327
commit 06eb890761
2 changed files with 28 additions and 5 deletions

View File

@@ -24,11 +24,13 @@ class ValidNumberTest {
"+71234567890",
"+447535742222",
"+4915174108888",
"+2250707312345",
"+298123456",
"+299123456",
"+376123456",
"+68512345",
"+689123456"})
"+689123456",
"+80011111111"})
void requireNormalizedNumber(final String number) {
assertDoesNotThrow(() -> Util.requireNormalizedNumber(number));
}
@@ -56,6 +58,8 @@ class ValidNumberTest {
@ParameterizedTest
@ValueSource(strings = {
"+4407700900111",
"+49493023125000", // double country code - this e164 is "possible"
"+494915110000000", // double country code - this e164 is "possible" and "valid"
"+1 415 123 1234",
"+1 (415) 123-1234",
"+1 415)123-1234",