MCPcopy Index your code
hub / github.com/segmentio/encoding / TestGithubIssue15

Function TestGithubIssue15

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

Source from the content-addressed store, hash-verified

1429}
1430
1431func TestGithubIssue15(t *testing.T) {
1432 // https://github.com/segmentio/encoding/issues/15
1433 tests := []struct {
1434 m any
1435 s string
1436 }{
1437 {
1438 m: map[uint]bool{1: true, 123: true, 333: true, 42: true},
1439 s: `{"1":true,"123":true,"333":true,"42":true}`,
1440 },
1441 {
1442 m: map[int]bool{-1: true, -123: true, 333: true, 42: true},
1443 s: `{"-1":true,"-123":true,"333":true,"42":true}`,
1444 },
1445 }
1446
1447 for _, test := range tests {
1448 b, _ := Marshal(test.m)
1449
1450 if string(b) != test.s {
1451 t.Error("map with integer keys must be ordered by their string representation, got", string(b))
1452 }
1453
1454 }
1455}
1456
1457type sliceA []byte
1458

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…