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

Function TestAppendInt64

msgp/write_bytes_test.go:256–271  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

254}
255
256func TestAppendInt64(t *testing.T) {
257 is := []int64{0, 1, -5, -50, int64(tint16), int64(tint32), tint64}
258 var buf bytes.Buffer
259 en := NewWriter(&buf)
260
261 var bts []byte
262 for _, i := range is {
263 buf.Reset()
264 en.WriteInt64(i)
265 en.Flush()
266 bts = AppendInt64(bts[0:0], i)
267 if !bytes.Equal(buf.Bytes(), bts) {
268 t.Errorf("for int64 %d, encoder wrote %q; append wrote %q", i, buf.Bytes(), bts)
269 }
270 }
271}
272
273func BenchmarkAppendInt64(b *testing.B) {
274 is := []int64{0, 1, -5, -50, int64(tint16), int64(tint32), tint64}

Callers

nothing calls this directly

Calls 6

WriteInt64Method · 0.95
FlushMethod · 0.95
NewWriterFunction · 0.85
AppendInt64Function · 0.85
ResetMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…