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

Function TestFirstLast

roaring64/roaring64_test.go:102–124  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

100}
101
102func TestFirstLast(t *testing.T) {
103 bm := New()
104 bm.AddInt(2)
105 bm.AddInt(4)
106 bm.AddInt(8)
107
108 assert.EqualValues(t, 2, bm.Minimum())
109 assert.EqualValues(t, 8, bm.Maximum())
110
111 i := 1 << 5
112
113 for ; i < (1 << 17); i++ {
114 bm.AddInt(i)
115
116 assert.EqualValues(t, 2, bm.Minimum())
117 assert.EqualValues(t, i, bm.Maximum())
118 }
119
120 bm.RunOptimize()
121
122 assert.EqualValues(t, 2, bm.Minimum())
123 assert.EqualValues(t, i-1, bm.Maximum())
124}
125
126func TestRoaringBitmapBitmapOf(t *testing.T) {
127 array := []uint64{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…