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

Function TestBitmapStructure_DelBit

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

Source from the content-addressed store, hash-verified

79}
80
81func TestBitmapStructure_DelBit(t *testing.T) {
82 bm := initBitmap()
83
84 err := bm.SetBits("1", 2, 3, 4, 5, 6)
85 assert.NoError(t, err)
86 val, _ := bm.GetBit("1", 2)
87 assert.True(t, val)
88 err = bm.DelBit("1", 2)
89 assert.NoError(t, err)
90 val, err = bm.GetBit("1", 2)
91 assert.NoError(t, err)
92 assert.False(t, val)
93 val, _ = bm.GetBit("1", 4)
94 assert.True(t, val)
95
96}
97func TestBitmapStructure_DelBits(t *testing.T) {
98 bm := initBitmap()
99

Callers

nothing calls this directly

Calls 4

initBitmapFunction · 0.85
DelBitMethod · 0.80
SetBitsMethod · 0.45
GetBitMethod · 0.45

Tested by

no test coverage detected