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

Function TestRoaringArray64AdvanceUntil

roaring64/roaringarray64_test.go:9–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestRoaringArray64AdvanceUntil(t *testing.T) {
10 bitmap := New()
11 low := uint64(1) << 32
12 mid := uint64(2) << 32
13 high := uint64(3) << 32
14 bitmap.AddRange(low-1, low+2)
15 bitmap.AddRange(mid-1, mid+2)
16 bitmap.AddRange(high-1, high+2)
17
18 assert.Equal(t, 0, bitmap.highlowcontainer.advanceUntil(0, -1))
19 assert.Equal(t, 1, bitmap.highlowcontainer.advanceUntil(1, -1))
20 assert.Equal(t, 2, bitmap.highlowcontainer.advanceUntil(2, -1))
21 assert.Equal(t, 3, bitmap.highlowcontainer.advanceUntil(3, -1))
22 assert.Equal(t, 4, bitmap.highlowcontainer.advanceUntil(4, -1))
23
24 assert.Equal(t, 1, bitmap.highlowcontainer.advanceUntil(0, 0))
25 assert.Equal(t, 2, bitmap.highlowcontainer.advanceUntil(1, 1))
26 assert.Equal(t, 3, bitmap.highlowcontainer.advanceUntil(2, 2))
27 assert.Equal(t, 4, bitmap.highlowcontainer.advanceUntil(3, 3))
28 assert.Equal(t, 5, bitmap.highlowcontainer.advanceUntil(4, 4))
29}
30
31func TestCopies(t *testing.T) {
32 tests := []struct {

Callers

nothing calls this directly

Calls 3

NewFunction · 0.70
AddRangeMethod · 0.45
advanceUntilMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…