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

Function TestAppendKey

internal/cbor/base_test.go:9–22  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestAppendKey(t *testing.T) {
10 want := make([]byte, 0)
11 want = append(want, 0xbf) // start string
12 want = append(want, 0x63) // length 3
13 want = append(want, []byte("key")...)
14
15 got := enc.AppendKey([]byte{}, "key")
16 if !bytes.Equal(got, want) {
17 t.Errorf("AppendKey(%v)\ngot: 0x%s\nwant: 0x%s",
18 "key",
19 hex.EncodeToString(got),
20 hex.EncodeToString(want))
21 }
22}

Callers

nothing calls this directly

Calls 1

AppendKeyMethod · 0.65

Tested by

no test coverage detected