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

Function TestIssue116

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

Source from the content-addressed store, hash-verified

11)
12
13func TestIssue116(t *testing.T) {
14 data := AppendInt64(nil, math.MinInt64)
15 i, _, err := ReadInt64Bytes(data)
16 if err != nil {
17 t.Fatal(err)
18 }
19 if i != math.MinInt64 {
20 t.Errorf("put %d in and got %d out", int64(math.MinInt64), i)
21 }
22
23 var buf bytes.Buffer
24
25 w := NewWriter(&buf)
26 w.WriteInt64(math.MinInt64)
27 w.Flush()
28 i, err = NewReader(&buf).ReadInt64()
29 if err != nil {
30 t.Fatal(err)
31 }
32 if i != math.MinInt64 {
33 t.Errorf("put %d in and got %d out", int64(math.MinInt64), i)
34 }
35}
36
37func TestAppendMapHeader(t *testing.T) {
38 szs := []uint32{0, 1, uint32(tint8), uint32(tint16), tuint32}

Callers

nothing calls this directly

Calls 7

WriteInt64Method · 0.95
FlushMethod · 0.95
AppendInt64Function · 0.85
ReadInt64BytesFunction · 0.85
NewWriterFunction · 0.85
NewReaderFunction · 0.85
ReadInt64Method · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…