MCPcopy Index your code
hub / github.com/vmihailenco/msgpack / TestEncoder

Function TestEncoder

types_test.go:292–308  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

290}
291
292func TestEncoder(t *testing.T) {
293 var buf bytes.Buffer
294 enc := msgpack.NewEncoder(&buf)
295 enc.SetCustomStructTag("json")
296 enc.SetSortMapKeys(true)
297 enc.UseCompactInts(true)
298
299 for i, test := range encoderTests {
300 buf.Reset()
301
302 err := enc.Encode(test.in)
303 require.Nil(t, err)
304
305 s := hex.EncodeToString(buf.Bytes())
306 require.Equal(t, test.wanted, s, "#%d", i)
307 }
308}
309
310type floatEncoderTest struct {
311 in interface{}

Callers

nothing calls this directly

Calls 5

SetCustomStructTagMethod · 0.95
SetSortMapKeysMethod · 0.95
UseCompactIntsMethod · 0.95
EncodeMethod · 0.95
ResetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…