MCPcopy
hub / github.com/golang/net / TestPunycodeErrors

Function TestPunycodeErrors

idna/punycode_test.go:182–198  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

180}
181
182func 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}

Callers

nothing calls this directly

Calls 3

decodeFunction · 0.85
encodeFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…