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

Function TestBitmapcontainerNextHasMany

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

Source from the content-addressed store, hash-verified

456}
457
458func TestBitmapcontainerNextHasMany(t *testing.T) {
459 t.Run("Empty Bitmap", func(t *testing.T) {
460 bc := newBitmapContainer()
461 iterator := newBitmapContainerManyIterator(bc)
462 high := uint64(1024)
463 buf := []uint64{}
464 result := iterator.nextMany64(high, buf)
465 assert.Equal(t, 0, result)
466 })
467
468 t.Run("512 in iterator and buf size 512", func(t *testing.T) {
469 bc := newBitmapContainer()
470 bc.iaddRange(0, 512)
471 iterator := newBitmapContainerManyIterator(bc)
472 high := uint64(1024)
473 buf := make([]uint64, 512)
474 result := iterator.nextMany64(high, buf)
475 assert.Equal(t, 512, result)
476 })
477
478 t.Run("512 in iterator and buf size 256", func(t *testing.T) {
479 bc := newBitmapContainer()
480 bc.iaddRange(0, 512)
481 iterator := newBitmapContainerManyIterator(bc)
482 high := uint64(1024)
483 buf := make([]uint64, 256)
484 result := iterator.nextMany64(high, buf)
485 assert.Equal(t, 256, result)
486 })
487}
488
489func TestBitmapcontainerOrArrayCardinality(t *testing.T) {
490 t.Run("Empty Bitmap and Empty Array", func(t *testing.T) {

Callers

nothing calls this directly

Calls 4

newBitmapContainerFunction · 0.85
nextMany64Method · 0.65
iaddRangeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…