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

Function TestWriteNil

msgp/write_test.go:177–194  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

175}
176
177func TestWriteNil(t *testing.T) {
178 var buf bytes.Buffer
179 wr := NewWriter(&buf)
180
181 err := wr.WriteNil()
182 if err != nil {
183 t.Fatal(err)
184 }
185 err = wr.Flush()
186 if err != nil {
187 t.Fatal(err)
188 }
189
190 bts := buf.Bytes()
191 if bts[0] != mnil {
192 t.Errorf("Expected %x; wrote %x", mnil, bts[0])
193 }
194}
195
196func TestWriteFloat64(t *testing.T) {
197 var buf bytes.Buffer

Callers

nothing calls this directly

Calls 3

WriteNilMethod · 0.95
FlushMethod · 0.95
NewWriterFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…