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

Function TestComplement

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

Source from the content-addressed store, hash-verified

340}
341
342func TestComplement(t *testing.T) {
343 ba := newBitArray(10)
344
345 ba.SetBit(5)
346
347 ba.complement()
348
349 if ok, _ := ba.GetBit(5); ok {
350 t.Errorf(`Expected clear.`)
351 }
352
353 if ok, _ := ba.GetBit(4); !ok {
354 t.Errorf(`Expected set.`)
355 }
356}
357
358func BenchmarkComplement(b *testing.B) {
359 ba := newBitArray(160000)

Callers

nothing calls this directly

Calls 4

newBitArrayFunction · 0.85
complementMethod · 0.80
SetBitMethod · 0.65
GetBitMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…