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

Function TestBitMapValidation

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

Source from the content-addressed store, hash-verified

2029}
2030
2031func TestBitMapValidation(t *testing.T) {
2032 bm := NewBitmap()
2033 bm.AddRange(0, 100)
2034 bm.AddRange(306, 406)
2035 bm.AddRange(102, 202)
2036 bm.AddRange(204, 304)
2037 assert.NoError(t, bm.Validate())
2038
2039 randomEntries := make([]uint64, 0, 1000)
2040 for i := 0; i < 1000; i++ {
2041 randomEntries = append(randomEntries, rand.Uint64())
2042 }
2043
2044 bm.AddMany(randomEntries)
2045 assert.NoError(t, bm.Validate())
2046
2047 randomEntries = make([]uint64, 0, 1000)
2048 for i := 0; i < 1000; i++ {
2049 randomEntries = append(randomEntries, uint64(i))
2050 }
2051 bm.AddMany(randomEntries)
2052 assert.NoError(t, bm.Validate())
2053}
2054
2055func TestRoaringArray64SortOrder(t *testing.T) {
2056 t.Run("Empty", func(t *testing.T) {

Callers

nothing calls this directly

Calls 4

AddRangeMethod · 0.95
ValidateMethod · 0.95
AddManyMethod · 0.95
NewBitmapFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…