MCPcopy
hub / github.com/RoaringBitmap/roaring / TestSerializationBasic037

Function TestSerializationBasic037

serialization_test.go:49–63  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

47}
48
49func TestSerializationBasic037(t *testing.T) {
50 rb := BitmapOf(1, 2, 3, 4, 5, 100, 1000)
51
52 buf := &bytes.Buffer{}
53 _, err := rb.WriteTo(buf)
54
55 require.NoError(t, err)
56 assert.EqualValues(t, buf.Len(), rb.GetSerializedSizeInBytes())
57
58 newrb := NewBitmap()
59 _, err = newrb.ReadFrom(buf)
60
61 require.NoError(t, err)
62 assert.True(t, rb.Equals(newrb))
63}
64
65func TestSerializationToFile038(t *testing.T) {
66 rb := BitmapOf(1, 2, 3, 4, 5, 100, 1000)

Callers

nothing calls this directly

Calls 7

ReadFromMethod · 0.95
BitmapOfFunction · 0.70
NewBitmapFunction · 0.70
WriteToMethod · 0.45
LenMethod · 0.45
EqualsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…