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

Function TestAndSparseWithDenseBitArray

bitarray/and_test.go:78–104  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

76}
77
78func TestAndSparseWithDenseBitArray(t *testing.T) {
79 sba := newSparseBitArray()
80 other := newBitArray(300)
81
82 other.SetBit(1)
83 sba.SetBit(1)
84 other.SetBit(150)
85 sba.SetBit(150)
86 sba.SetBit(155)
87 other.SetBit(156)
88 sba.SetBit(300)
89 other.SetBit(300)
90
91 ba := andSparseWithDenseBitArray(sba, other)
92
93 // Bits in both
94 checkBit(t, ba, 1, true)
95 checkBit(t, ba, 150, true)
96 checkBit(t, ba, 300, true)
97
98 // Bits in sba but not other
99 checkBit(t, ba, 155, false)
100
101 // Bits in other but not sba
102 checkBit(t, ba, 156, false)
103
104}
105
106// Make sure that the sparse array is trimmed correctly if compared against a
107// smaller dense bit array.

Callers

nothing calls this directly

Calls 5

newSparseBitArrayFunction · 0.85
newBitArrayFunction · 0.85
checkBitFunction · 0.85
SetBitMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…