(t *testing.T)
| 180 | } |
| 181 | |
| 182 | func TestPunycodeErrors(t *testing.T) { |
| 183 | for _, tc := range punycodeErrorTestCases { |
| 184 | var err error |
| 185 | switch { |
| 186 | case strings.HasPrefix(tc, "decode "): |
| 187 | _, err = decode(tc[7:]) |
| 188 | case strings.HasPrefix(tc, "encode "): |
| 189 | _, err = encode("", tc[7:]) |
| 190 | } |
| 191 | if err == nil { |
| 192 | if len(tc) > 256 { |
| 193 | tc = tc[:100] + "..." + tc[len(tc)-100:] |
| 194 | } |
| 195 | t.Errorf("no error for %s", tc) |
| 196 | } |
| 197 | } |
| 198 | } |