MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / TestBitmapStructure_DelBits

Function TestBitmapStructure_DelBits

structure/bitmap_test.go:97–114  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

95
96}
97func TestBitmapStructure_DelBits(t *testing.T) {
98 bm := initBitmap()
99
100 err := bm.SetBits("1", 2, 3, 4, 5, 6)
101 assert.NoError(t, err)
102 err = bm.DelBits("1", 4, 5)
103 assert.NoError(t, err)
104 val, err := bm.GetBit("1", 2)
105 assert.NoError(t, err)
106 assert.True(t, val)
107 val, _ = bm.GetBit("1", 4)
108 assert.False(t, val)
109 val, _ = bm.GetBit("1", 5)
110 assert.False(t, val)
111 val, _ = bm.GetBit("1", 6)
112 assert.True(t, val)
113
114}
115
116func TestBitmapStructure_BitCount(t *testing.T) {
117 bm := initBitmap()

Callers

nothing calls this directly

Calls 4

initBitmapFunction · 0.85
DelBitsMethod · 0.80
SetBitsMethod · 0.45
GetBitMethod · 0.45

Tested by

no test coverage detected