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

Function TestDecodeCbor2Json

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

Source from the content-addressed store, hash-verified

238}
239
240func TestDecodeCbor2Json(t *testing.T) {
241 for _, tc := range compositeCborTestCases {
242 buf := bytes.NewBuffer([]byte{})
243 err := Cbor2JsonManyObjects(getReader(string(tc.Binary)), buf)
244 if buf.String() != tc.Json || err != nil {
245 t.Errorf("cbor2JsonManyObjects(0x%s)=%s, want: %s, err:%s", hex.EncodeToString(tc.Binary), buf.String(), tc.Json, err.Error())
246 }
247 }
248}
249
250var negativeCborTestCases = []struct {
251 Binary []byte

Callers

nothing calls this directly

Calls 4

Cbor2JsonManyObjectsFunction · 0.85
getReaderFunction · 0.85
StringMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected