(t *testing.T)
| 59 | } |
| 60 | |
| 61 | func TestIssue181(t *testing.T) { |
| 62 | t.Run("Initial issue 181", func(t *testing.T) { |
| 63 | a := New() |
| 64 | var x uint32 |
| 65 | |
| 66 | // adding 1M integers |
| 67 | for i := 1; i <= 1000000; i++ { |
| 68 | x += uint32(rand.Intn(10) + 1) |
| 69 | a.Add(x) |
| 70 | } |
| 71 | b := New() |
| 72 | for i := 1; i <= int(x); i++ { |
| 73 | b.Add(uint32(i)) |
| 74 | } |
| 75 | |
| 76 | assert.Equal(t, b.AndCardinality(a), a.AndCardinality(b)) |
| 77 | assert.Equal(t, b.AndCardinality(a), And(a, b).GetCardinality()) |
| 78 | }) |
| 79 | |
| 80 | t.Run("Second version of issue 181", func(t *testing.T) { |
| 81 | a := New() |
| 82 | var x uint32 |
| 83 | |
| 84 | // adding 1M integers |
| 85 | for i := 1; i <= 1000000; i++ { |
| 86 | x += uint32(rand.Intn(10) + 1) |
| 87 | a.Add(x) |
| 88 | } |
| 89 | b := New() |
| 90 | b.AddRange(1, uint64(x)) |
| 91 | |
| 92 | assert.Equal(t, b.AndCardinality(a), a.AndCardinality(b)) |
| 93 | assert.Equal(t, b.AndCardinality(a), And(a, b).GetCardinality()) |
| 94 | }) |
| 95 | } |
| 96 | |
| 97 | // RunReverseIterator16 unit tests for cur, next, hasNext, and remove should pass |
| 98 | func TestBitmapContainerReverseIterator(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…