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

Function TestBitMapStructure_BitDel

structure/bitmap_1_test.go:92–104  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

90}
91
92func TestBitMapStructure_BitDel(t *testing.T) {
93 bitmap := initBitMap()
94 defer bitmap.db.Clean()
95
96 // Test BitDel function
97 bitmapErr = bitmap.SetBits(string(randkv.GetTestKey(1)), 0, true, 1, false, 2, true)
98 assert.Nil(t, bitmapErr)
99 bitmapErr = bitmap.BitDel(string(randkv.GetTestKey(1)), 1)
100 assert.Nil(t, bitmapErr)
101 values, err := bitmap.GetBits(string(randkv.GetTestKey(1)), 0, 1)
102 assert.Nil(t, err)
103 assert.Equal(t, []bool{true, true}, values)
104}
105
106func TestBitMapStructure_BitDels(t *testing.T) {
107 bitmap := initBitMap()

Callers

nothing calls this directly

Calls 6

GetTestKeyFunction · 0.92
initBitMapFunction · 0.85
BitDelMethod · 0.80
CleanMethod · 0.45
SetBitsMethod · 0.45
GetBitsMethod · 0.45

Tested by

no test coverage detected