MCPcopy
hub / github.com/tinylib/msgp / TestReadNilBytes

Function TestReadNilBytes

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

Source from the content-addressed store, hash-verified

143}
144
145func TestReadNilBytes(t *testing.T) {
146 var buf bytes.Buffer
147 en := NewWriter(&buf)
148 en.WriteNil()
149 en.Flush()
150
151 left, err := ReadNilBytes(buf.Bytes())
152 if err != nil {
153 t.Fatal(err)
154 }
155 if len(left) != 0 {
156 t.Errorf("expected 0 bytes left; found %d", len(left))
157 }
158}
159
160func BenchmarkReadNilByte(b *testing.B) {
161 buf := []byte{mnil}

Callers

nothing calls this directly

Calls 4

WriteNilMethod · 0.95
FlushMethod · 0.95
NewWriterFunction · 0.85
ReadNilBytesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…