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

Function TestFloatEncoding

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

Source from the content-addressed store, hash-verified

330}
331
332func TestFloatEncoding(t *testing.T) {
333 var buf bytes.Buffer
334 enc := msgpack.NewEncoder(&buf)
335 enc.UseCompactInts(true)
336
337 for _, test := range floatEncoderTests {
338 buf.Reset()
339
340 enc.UseCompactFloats(test.compact)
341
342 err := enc.Encode(test.in)
343 if err != nil {
344 t.Fatal(err)
345 }
346
347 s := hex.EncodeToString(buf.Bytes())
348 if s != test.wanted {
349 t.Fatalf("%s != %s (in=%#v)", s, test.wanted, test.in)
350 }
351 }
352}
353
354//------------------------------------------------------------------------------
355

Callers

nothing calls this directly

Calls 4

UseCompactIntsMethod · 0.95
UseCompactFloatsMethod · 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…