Skip to content

Commit ae117dc

Browse files
committed
added unit test
1 parent c60edc5 commit ae117dc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

roaring_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,6 +1827,20 @@ func TestBitmap(t *testing.T) {
18271827

18281828
assert.True(t, valide)
18291829
})
1830+
1831+
t.Run("ToExistingArray-Test", func(t *testing.T) {
1832+
values := make([]uint32, 0, 110)
1833+
rb := NewBitmap()
1834+
1835+
for i := 10; i < 120; i++ {
1836+
values = append(values, uint32(i))
1837+
}
1838+
rb.AddMany(values)
1839+
assert.Equal(t, values, rb.ToArray())
1840+
existing := make([]uint32, len(values))
1841+
buf := rb.ToExistingArray(&existing)
1842+
assert.Equal(t, values, *buf)
1843+
})
18301844
}
18311845

18321846
func TestXORtest4(t *testing.T) {

0 commit comments

Comments
 (0)