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

Function TestIteratorPeekNext

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

Source from the content-addressed store, hash-verified

3090}
3091
3092func TestIteratorPeekNext(t *testing.T) {
3093 values := []uint32{0, 2, 15, 16, 31, 32, 33, 9999, MaxUint16, MaxUint32}
3094 bm := New()
3095
3096 for n := 0; n < len(values); n++ {
3097 bm.Add(values[n])
3098 }
3099
3100 i := bm.Iterator()
3101 assert.True(t, i.HasNext())
3102
3103 for i.HasNext() {
3104 assert.Equal(t, i.PeekNext(), i.Next())
3105 }
3106}
3107
3108func TestIteratorAdvance(t *testing.T) {
3109 values := []uint32{1, 2, 15, 16, 31, 32, 33, 9999, MaxUint16}

Callers

nothing calls this directly

Calls 6

NewFunction · 0.70
HasNextMethod · 0.65
PeekNextMethod · 0.65
NextMethod · 0.65
AddMethod · 0.45
IteratorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…