MCPcopy Index your code
hub / github.com/tinylib/msgp / TestReadComplex64Bytes

Function TestReadComplex64Bytes

msgp/read_bytes_test.go:638–660  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

636}
637
638func TestReadComplex64Bytes(t *testing.T) {
639 var buf bytes.Buffer
640 en := NewWriter(&buf)
641
642 tests := []complex64{complex(0, 0), complex(12.8, 32.0)}
643
644 for i, v := range tests {
645 buf.Reset()
646 en.WriteComplex64(v)
647 en.Flush()
648
649 out, left, err := ReadComplex64Bytes(buf.Bytes())
650 if err != nil {
651 t.Errorf("test case %d: %s", i, err)
652 }
653 if len(left) != 0 {
654 t.Errorf("expected 0 bytes left; found %d", len(left))
655 }
656 if out != v {
657 t.Errorf("%f in; %f out", v, out)
658 }
659 }
660}
661
662func TestReadTimeBytes(t *testing.T) {
663 var buf bytes.Buffer

Callers

nothing calls this directly

Calls 5

WriteComplex64Method · 0.95
FlushMethod · 0.95
NewWriterFunction · 0.85
ReadComplex64BytesFunction · 0.85
ResetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…