(t *testing.T)
| 56 | } |
| 57 | |
| 58 | func TestPostalCodeFormat(t *testing.T) { |
| 59 | |
| 60 | for _, pt := range postalcodeTests { |
| 61 | code := PostalCode(pt.Country) |
| 62 | |
| 63 | switch pt.Country { |
| 64 | case "GB": |
| 65 | matched, err := regexp.MatchString("^\\S{1,2}\\d{1,2} \\d\\S{1,2}", code) |
| 66 | if err != nil { |
| 67 | t.Errorf("error matching %v", err) |
| 68 | } |
| 69 | |
| 70 | if !matched { |
| 71 | t.Fatalf("Invalid format for country %q", |
| 72 | pt.Country) |
| 73 | } |
| 74 | |
| 75 | } |
| 76 | } |
| 77 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…