MCPcopy
hub / github.com/rs/zerolog / TestDecodeMap

Function TestDecodeMap

internal/cbor/decoder_test.go:87–102  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

85}
86
87func TestDecodeMap(t *testing.T) {
88 for _, tc := range mapDecodeTestCases {
89 buf := bytes.NewBuffer([]byte{})
90 map2Json(getReader(string(tc.Bin)), buf)
91 if buf.String() != tc.Json {
92 t.Errorf("map2Json(0x%s)=%s, want: %s", hex.EncodeToString(tc.Bin), buf.String(), tc.Json)
93 }
94 }
95 for _, tc := range infiniteMapDecodeTestCases {
96 buf := bytes.NewBuffer([]byte{})
97 map2Json(getReader(string(tc.Bin)), buf)
98 if buf.String() != tc.Json {
99 t.Errorf("map2Json(0x%s)=%s, want: %s", hex.EncodeToString(tc.Bin), buf.String(), tc.Json)
100 }
101 }
102}
103
104func TestDecodeBool(t *testing.T) {
105 for _, tc := range internal.BooleanTestCases {

Callers

nothing calls this directly

Calls 3

map2JsonFunction · 0.85
getReaderFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected