(t *testing.T)
| 299 | } |
| 300 | |
| 301 | func TestIntersects(t *testing.T) { |
| 302 | ba := newBitArray(10) |
| 303 | other := newBitArray(ba.Capacity()) |
| 304 | |
| 305 | ba.SetBit(1) |
| 306 | ba.SetBit(2) |
| 307 | |
| 308 | other.SetBit(1) |
| 309 | |
| 310 | if !ba.Intersects(other) { |
| 311 | t.Errorf(`Is intersecting.`) |
| 312 | } |
| 313 | |
| 314 | other.SetBit(5) |
| 315 | |
| 316 | if ba.Intersects(other) { |
| 317 | t.Errorf(`Is not intersecting.`) |
| 318 | } |
| 319 | |
| 320 | other = newBitArray(ba.Capacity() + 1) |
| 321 | other.SetBit(1) |
| 322 | |
| 323 | if ba.Intersects(other) { |
| 324 | t.Errorf(`Is not intersecting.`) |
| 325 | } |
| 326 | } |
| 327 | |
| 328 | func BenchmarkIntersects(b *testing.B) { |
| 329 | ba := newBitArray(162432) |
nothing calls this directly
no test coverage detected
searching dependent graphs…