MCPcopy Index your code
hub / github.com/Workiva/go-datastructures / TestIntersects

Function TestIntersects

bitarray/bitarray_test.go:301–326  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

299}
300
301func 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
328func BenchmarkIntersects(b *testing.B) {
329 ba := newBitArray(162432)

Callers

nothing calls this directly

Calls 4

newBitArrayFunction · 0.85
CapacityMethod · 0.65
SetBitMethod · 0.65
IntersectsMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…