diff --git a/rates_test.go b/rates_test.go index a566cce..b34b861 100644 --- a/rates_test.go +++ b/rates_test.go @@ -17,8 +17,8 @@ func TestCountryRates_GetRate(t *testing.T) { } c, _ = GetCountryRates("RO") - if r, _ := c.GetRate("standard"); r != 19 { - t.Errorf("Standard VAT rate for RO is supposed to be 19. Got %.2f", r) + if r, _ := c.GetRate("standard"); r != 21 { + t.Errorf("Standard VAT rate for RO is supposed to be 21. Got %.2f", r) } } diff --git a/validate.go b/validate.go index 7636281..a963549 100644 --- a/validate.go +++ b/validate.go @@ -33,7 +33,7 @@ func ValidateFormat(vatNumber string) error { "EL": `[0-9]{9}`, "ES": `[A-Z][0-9]{7}[A-Z]|[0-9]{8}[A-Z]|[A-Z][0-9]{8}`, "FI": `[0-9]{8}`, - "FR": `([A-Z]{2}|[0-9]{2})[0-9]{9}`, + "FR": `[A-Z0-9]{2}[0-9]{9}`, // Supposedly the regex for GB numbers is `[0-9]{9}|[0-9]{12}|(GD|HA)[0-9]{3}`, // but our validator service only accepts numbers with 9 or 12 digits following the country code. // Seems like the official site only accepts 9 digits... https://www.gov.uk/check-uk-vat-number diff --git a/validate_test.go b/validate_test.go index 8bcbd95..59d811b 100644 --- a/validate_test.go +++ b/validate_test.go @@ -49,6 +49,9 @@ var tests = []struct { {"FI1234567", ErrInvalidVATNumberFormat}, {"FI12345678", nil}, {"FR12345678901", nil}, + {"FR1B345678901", nil}, + {"FRAB345678901", nil}, + {"FRABC45678901", ErrInvalidVATNumberFormat}, {"FR1234567890", ErrInvalidVATNumberFormat}, {"GB999999973", nil}, {"GB156730098481", nil},