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

Function TestBitmapStructure_GetBits

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

Source from the content-addressed store, hash-verified

48}
49
50func TestBitmapStructure_GetBits(t *testing.T) {
51 // Setup the bitmap structure
52 bm := initBitmap()
53
54 err := bm.SetBit("1", 2)
55 assert.NoError(t, err)
56 val, err := bm.GetBits("1")
57 assert.NoError(t, err)
58 assert.True(t, val.At(2))
59
60 // add one other bit
61 err = bm.SetBit("1", 7)
62 val, err = bm.GetBits("1")
63 assert.NoError(t, err)
64 assert.True(t, val.At(7))
65 assert.False(t, val.At(8))
66}
67
68func TestBitmapStructure_GetBit(t *testing.T) {
69 // Setup the bitmap structure

Callers

nothing calls this directly

Calls 4

initBitmapFunction · 0.85
AtMethod · 0.80
SetBitMethod · 0.45
GetBitsMethod · 0.45

Tested by

no test coverage detected