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

Function TestArrayContainerIAndNot

arraycontainer_test.go:340–359  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

338}
339
340func TestArrayContainerIAndNot(t *testing.T) {
341 var ac container
342 ac = newArrayContainer()
343 ac.iadd(12)
344 ac.iadd(27)
345 ac.iadd(32)
346 ac.iadd(88)
347 ac.iadd(188)
348 ac.iadd(289)
349
350 var rc container
351 rc = newRunContainer16Range(0, 15)
352 rc = rc.iaddRange(1500, 2000)
353 rc = rc.iaddRange(55, 100)
354 rc = rc.iaddRange(25, 50)
355 ac = ac.iandNot(rc)
356
357 require.ElementsMatch(t, []uint16{188, 289}, ac.(*arrayContainer).content)
358 require.Equal(t, 2, ac.getCardinality())
359}
360
361func TestArrayContainerIand(t *testing.T) {
362 a := NewBitmap()

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…