MCPcopy
hub / github.com/RoaringBitmap/roaring / TestRangeRemoval

Function TestRangeRemoval

roaring_test.go:980–1000  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

978}
979
980func TestRangeRemoval(t *testing.T) {
981 bm := NewBitmap()
982 bm.Add(1)
983 bm.AddRange(21, 26)
984 bm.AddRange(9, 14)
985 bm.RemoveRange(11, 16)
986 bm.RemoveRange(1, 26)
987 c := bm.GetCardinality()
988
989 assert.EqualValues(t, 0, c)
990
991 bm.AddRange(1, 10000)
992 c = bm.GetCardinality()
993
994 assert.EqualValues(t, 10000-1, c)
995
996 bm.RemoveRange(1, 10000)
997 c = bm.GetCardinality()
998
999 assert.EqualValues(t, 0, c)
1000}
1001
1002func TestRangeRemovalFromContent(t *testing.T) {
1003 bm := NewBitmap()

Callers

nothing calls this directly

Calls 5

AddMethod · 0.95
AddRangeMethod · 0.95
RemoveRangeMethod · 0.95
GetCardinalityMethod · 0.95
NewBitmapFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…