MCPcopy Create free account
hub / github.com/segmentio/encoding / TestGithubIssue11

Function TestGithubIssue11

json/json_test.go:1370–1384  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1368}
1369
1370func TestGithubIssue11(t *testing.T) {
1371 // https://github.com/segmentio/encoding/issues/11
1372 v := struct{ F float64 }{
1373 F: math.NaN(),
1374 }
1375
1376 _, err := Marshal(v)
1377 if err == nil {
1378 t.Error("no error returned when marshalling NaN value")
1379 } else if s := err.Error(); !strings.Contains(s, "NaN") {
1380 t.Error("error returned when marshalling NaN value does not mention 'NaN':", s)
1381 } else {
1382 t.Log(s)
1383 }
1384}
1385
1386type Issue13 struct {
1387 Stringer fmt.Stringer

Callers

nothing calls this directly

Calls 2

MarshalFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…