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

Function TestBitmapRank2

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

Source from the content-addressed store, hash-verified

1032}
1033
1034func TestBitmapRank2(t *testing.T) {
1035 r := NewBitmap()
1036 for i := uint32(1); i < 8194; i += 2 {
1037 r.Add(i)
1038 }
1039
1040 rank := r.Rank(63)
1041 assert.EqualValues(t, 32, rank)
1042}
1043
1044// TestCardinalityInRangeEquivalence verifies that CardinalityInRange(start, end) == Rank(end-1) - Rank(start-1)
1045// for many inputs, across all container types.

Callers

nothing calls this directly

Calls 3

AddMethod · 0.95
RankMethod · 0.95
NewBitmapFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…