MCPcopy Create free account
hub / github.com/RoaringBitmap/roaring / TestFirstLast

Function TestFirstLast

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

Source from the content-addressed store, hash-verified

647}
648
649func TestFirstLast(t *testing.T) {
650 bm := New()
651 bm.AddInt(2)
652 bm.AddInt(4)
653 bm.AddInt(8)
654
655 assert.EqualValues(t, 2, bm.Minimum())
656 assert.EqualValues(t, 8, bm.Maximum())
657
658 i := 1 << 5
659
660 for ; i < (1 << 17); i++ {
661 bm.AddInt(i)
662
663 assert.EqualValues(t, 2, bm.Minimum())
664 assert.EqualValues(t, i, bm.Maximum())
665 }
666
667 bm.RunOptimize()
668
669 assert.EqualValues(t, 2, bm.Minimum())
670 assert.EqualValues(t, i-1, bm.Maximum())
671}
672
673func TestRoaringBitmapBitmapOf(t *testing.T) {
674 array := []uint32{5580, 33722, 44031, 57276, 83097}

Callers

nothing calls this directly

Calls 5

NewFunction · 0.70
AddIntMethod · 0.45
MinimumMethod · 0.45
MaximumMethod · 0.45
RunOptimizeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…