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

Function TestBitmapcontainerOrArrayCardinality

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

Source from the content-addressed store, hash-verified

487}
488
489func TestBitmapcontainerOrArrayCardinality(t *testing.T) {
490 t.Run("Empty Bitmap and Empty Array", func(t *testing.T) {
491 array := newArrayContainer()
492 bc := newBitmapContainer()
493 result := bc.orArrayCardinality(array)
494
495 assert.Equal(t, 0, result)
496 })
497
498 t.Run("Populated Bitmap with Empty Array", func(t *testing.T) {
499 bc := newBitmapContainer()
500 bc.iaddRange(0, 1024)
501 array := newArrayContainer()
502
503 result := bc.orArrayCardinality(array)
504
505 assert.Equal(t, 1024, result)
506 })
507
508 t.Run("Populated Bitmap with Empty Run Container", func(t *testing.T) {
509 bc := newBitmapContainer()
510 bc.iaddRange(0, 1024)
511
512 runC := newRunContainer16()
513
514 result := runC.orBitmapContainerCardinality(bc)
515
516 assert.Equal(t, 1024, result)
517
518 other := newBitmapContainerFromRun(runC)
519 result = bc.orBitmapCardinality(other)
520
521 assert.Equal(t, 1024, result)
522 })
523
524 t.Run("Populated Bitmap with Empty Bitmap", func(t *testing.T) {
525 bc := newBitmapContainer()
526 bc.iaddRange(0, 1024)
527
528 other := newBitmapContainer()
529
530 result := bc.orBitmapCardinality(other)
531
532 assert.Equal(t, 1024, result)
533 })
534}

Callers

nothing calls this directly

Calls 8

newArrayContainerFunction · 0.85
newBitmapContainerFunction · 0.85
newRunContainer16Function · 0.85
orBitmapCardinalityMethod · 0.80
iaddRangeMethod · 0.65
orArrayCardinalityMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…