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

Function TestBitmapContainerIAndNot

bitmapcontainer_test.go:311–330  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

309}
310
311func TestBitmapContainerIAndNot(t *testing.T) {
312 var bc container
313 bc = newBitmapContainer()
314 for i := 0; i < arrayDefaultMaxSize; i++ {
315 bc.iadd(uint16(i * 3))
316 }
317 bc.iadd(math.MaxUint16)
318
319 var rc container
320 rc = newRunContainer16Range(0, 1)
321 for i := 0; i < arrayDefaultMaxSize-3; i++ {
322 rc = rc.iaddRange(i*3, i*3+1)
323 }
324 rc.iaddRange(math.MaxUint16-3, math.MaxUint16+1)
325
326 bc = bc.iandNot(rc)
327
328 require.ElementsMatch(t, []uint16{12279, 12282, 12285}, bc.(*arrayContainer).content)
329 require.Equal(t, 3, bc.getCardinality())
330}
331
332func TestPreviousNexts(t *testing.T) {
333 bc := newBitmapContainer()

Callers

nothing calls this directly

Calls 6

iaddMethod · 0.95
iaddRangeMethod · 0.95
iandNotMethod · 0.95
getCardinalityMethod · 0.95
newBitmapContainerFunction · 0.85
newRunContainer16RangeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…