(t *testing.T)
| 237 | } |
| 238 | |
| 239 | func TestLongCompressedIntersects(t *testing.T) { |
| 240 | ba := newSparseBitArray() |
| 241 | other := newSparseBitArray() |
| 242 | |
| 243 | ba.SetBit(5) |
| 244 | other.SetBit(5) |
| 245 | |
| 246 | assert.True(t, ba.Intersects(other)) |
| 247 | |
| 248 | other.SetBit(s * 2) |
| 249 | |
| 250 | assert.False(t, ba.Intersects(other)) |
| 251 | assert.True(t, other.Intersects(ba)) |
| 252 | |
| 253 | ba.SetBit(s * 2) |
| 254 | |
| 255 | assert.True(t, ba.Intersects(other)) |
| 256 | assert.True(t, other.Intersects(ba)) |
| 257 | |
| 258 | other.SetBit(s*2 + 1) |
| 259 | |
| 260 | assert.False(t, ba.Intersects(other)) |
| 261 | assert.True(t, other.Intersects(ba)) |
| 262 | } |
| 263 | |
| 264 | func BenchmarkCompressedIntersects(b *testing.B) { |
| 265 | numItems := uint64(1000) |
nothing calls this directly
no test coverage detected
searching dependent graphs…