MCPcopy
hub / github.com/vmihailenco/msgpack / TestInternedStringTag

Function TestInternedStringTag

intern_test.go:55–73  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

53}
54
55func TestInternedStringTag(t *testing.T) {
56 var buf bytes.Buffer
57 enc := msgpack.NewEncoder(&buf)
58 dec := msgpack.NewDecoder(&buf)
59
60 in := []Intern{
61 {"f", "f", "f"},
62 {"fo", "fo", "fo"},
63 {"foo", "foo", "foo"},
64 {"f", "fo", "foo"},
65 }
66 err := enc.Encode(in)
67 require.Nil(t, err)
68
69 var out []Intern
70 err = dec.Decode(&out)
71 require.Nil(t, err)
72 require.Equal(t, in, out)
73}
74
75func TestResetDict(t *testing.T) {
76 dict := []string{"hello world", "foo bar"}

Callers

nothing calls this directly

Calls 2

EncodeMethod · 0.95
DecodeMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…