[
{"name": "a UK mobile in national form loses its trunk 0", "args": ["07700 900123", "GB"], "expect": {"valid": true, "normalised": "+447700900123", "callingCode": "44", "nationalNumber": "7700900123", "reason": null}},
{"name": "an international number ignores the default country", "args": ["+44 7700 900123", "US"], "expect": {"valid": true, "normalised": "+447700900123", "callingCode": "44", "nationalNumber": "7700900123", "reason": null}},
{"name": "international form needs no default country", "args": ["+44 7700 900123", ""], "expect": {"valid": true, "normalised": "+447700900123", "callingCode": "44", "nationalNumber": "7700900123", "reason": null}},
{"name": "the UK habit of writing (0) after the country code", "args": ["+44 (0)20 7946 0018", "GB"], "expect": {"valid": true, "normalised": "+442079460018", "callingCode": "44", "nationalNumber": "2079460018", "reason": null}},
{"name": "00 is how the UK dials out, so 0044 is international", "args": ["0044 20 7946 0018", "GB"], "expect": {"valid": true, "normalised": "+442079460018", "callingCode": "44", "nationalNumber": "2079460018", "reason": null}},
{"name": "a US number with the area code in brackets", "args": ["(212) 555-0123", "US"], "expect": {"valid": true, "normalised": "+12125550123", "callingCode": "1", "nationalNumber": "2125550123", "reason": null}},
{"name": "a US number with the leading 1 trunk prefix", "args": ["1-212-555-0123", "US"], "expect": {"valid": true, "normalised": "+12125550123", "callingCode": "1", "nationalNumber": "2125550123", "reason": null}},
{"name": "011 is how North America dials out", "args": ["011 44 20 7946 0018", "US"], "expect": {"valid": true, "normalised": "+442079460018", "callingCode": "44", "nationalNumber": "2079460018", "reason": null}},
{"name": "Canada shares +1 with the US", "args": ["+1 416 555 0199", "CA"], "expect": {"valid": true, "normalised": "+14165550199", "callingCode": "1", "nationalNumber": "4165550199", "reason": null}},
{"name": "an Australian landline in national form", "args": ["(02) 9876 5432", "AU"], "expect": {"valid": true, "normalised": "+61298765432", "callingCode": "61", "nationalNumber": "298765432", "reason": null}},
{"name": "0011 is how Australia dials out, not 00", "args": ["0011 44 7700 900123", "AU"], "expect": {"valid": true, "normalised": "+447700900123", "callingCode": "44", "nationalNumber": "7700900123", "reason": null}},
{"name": "Italy keeps the leading 0 of a landline after +39", "args": ["06 1234 5678", "IT"], "expect": {"valid": true, "normalised": "+390612345678", "callingCode": "39", "nationalNumber": "0612345678", "reason": null}},
{"name": "Spain has no trunk prefix", "args": ["612 34 56 78", "ES"], "expect": {"valid": true, "normalised": "+34612345678", "callingCode": "34", "nationalNumber": "612345678", "reason": null}},
{"name": "a French number written in pairs", "args": ["01 23 45 67 89", "FR"], "expect": {"valid": true, "normalised": "+33123456789", "callingCode": "33", "nationalNumber": "123456789", "reason": null}},
{"name": "a Berlin number", "args": ["030 12345678", "DE"], "expect": {"valid": true, "normalised": "+493012345678", "callingCode": "49", "nationalNumber": "3012345678", "reason": null}},
{"name": "an Irish mobile", "args": ["087 123 4567", "IE"], "expect": {"valid": true, "normalised": "+353871234567", "callingCode": "353", "nationalNumber": "871234567", "reason": null}},
{"name": "a New Zealand mobile", "args": ["021 123 4567", "NZ"], "expect": {"valid": true, "normalised": "+64211234567", "callingCode": "64", "nationalNumber": "211234567", "reason": null}},
{"name": "an Indian mobile", "args": ["098765 43210", "IN"], "expect": {"valid": true, "normalised": "+919876543210", "callingCode": "91", "nationalNumber": "9876543210", "reason": null}},
{"name": "a Dutch mobile, with dots", "args": ["06.1234.5678", "NL"], "expect": {"valid": true, "normalised": "+31612345678", "callingCode": "31", "nationalNumber": "612345678", "reason": null}},
{"name": "the default country is read case-insensitively", "args": ["07700 900123", "gb"], "expect": {"valid": true, "normalised": "+447700900123", "callingCode": "44", "nationalNumber": "7700900123", "reason": null}},
{"name": "a UK number one digit too long", "args": ["07700 9001234", "GB"], "expect": {"valid": false, "normalised": null, "callingCode": null, "nationalNumber": null, "reason": "bad-length"}},
{"name": "a US number one digit short", "args": ["212 555 012", "US"], "expect": {"valid": false, "normalised": null, "callingCode": null, "nationalNumber": null, "reason": "bad-length"}},
{"name": "a North American area code cannot start with 0", "args": ["(012) 555-0123", "US"], "expect": {"valid": false, "normalised": null, "callingCode": null, "nationalNumber": null, "reason": "bad-prefix"}},
{"name": "a calling code outside the supported countries", "args": ["+999 123456", "GB"], "expect": {"valid": false, "normalised": null, "callingCode": null, "nationalNumber": null, "reason": "unknown-country-code"}},
{"name": "a national number with no default country to read it in", "args": ["020 7946 0018", ""], "expect": {"valid": false, "normalised": null, "callingCode": null, "nationalNumber": null, "reason": "no-country"}},
{"name": "letters, as in a vanity number", "args": ["0800 FLOWERS", "GB"], "expect": {"valid": false, "normalised": null, "callingCode": null, "nationalNumber": null, "reason": "bad-character"}},
{"name": "a plus sign that is not at the start", "args": ["44+2079460018", "GB"], "expect": {"valid": false, "normalised": null, "callingCode": null, "nationalNumber": null, "reason": "bad-format"}},
{"name": "a plus sign and nothing else", "args": ["+", "GB"], "expect": {"valid": false, "normalised": null, "callingCode": null, "nationalNumber": null, "reason": "bad-format"}},
{"name": "the empty string", "args": ["", "GB"], "expect": {"valid": false, "normalised": null, "callingCode": null, "nationalNumber": null, "reason": "empty"}},
{"name": "separators and nothing else", "args": ["( ) -", "GB"], "expect": {"valid": false, "normalised": null, "callingCode": null, "nationalNumber": null, "reason": "empty"}},
{"name": "an unsupported default country is a programming error", "args": ["07700 900123", "XX"], "expectError": "unsupported default country"}
]