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

Function TestBitmapStructure_SetBits

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

Source from the content-addressed store, hash-verified

31
32}
33func TestBitmapStructure_SetBits(t *testing.T) {
34 // Setup the bitmap structure
35 bm := initBitmap()
36 err := bm.SetBits("1", 7, 4, 2, 9)
37 assert.NoError(t, err)
38 val, err := bm.GetBits("1")
39
40 assert.NoError(t, err)
41 assert.True(t, val.At(7))
42 assert.True(t, val.At(9))
43 assert.True(t, val.At(4))
44 assert.True(t, val.At(2))
45 assert.False(t, val.At(1))
46 assert.False(t, val.At(10))
47
48}
49
50func TestBitmapStructure_GetBits(t *testing.T) {
51 // Setup the bitmap structure

Callers

nothing calls this directly

Calls 4

initBitmapFunction · 0.85
AtMethod · 0.80
SetBitsMethod · 0.45
GetBitsMethod · 0.45

Tested by

no test coverage detected