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

Function TestSparseEqualsBitArray

bitarray/sparse_bitarray_test.go:307–324  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

305}
306
307func TestSparseEqualsBitArray(t *testing.T) {
308 cba := newSparseBitArray()
309 ba := newBitArray(s * 2)
310
311 assert.True(t, cba.Equals(ba))
312
313 ba.SetBit(5)
314 assert.False(t, cba.Equals(ba))
315
316 cba.SetBit(5)
317 assert.True(t, cba.Equals(ba))
318
319 ba.SetBit(s + 1)
320 assert.False(t, cba.Equals(ba))
321
322 cba.SetBit(s + 1)
323 assert.True(t, cba.Equals(ba))
324}
325
326func BenchmarkCompressedEquals(b *testing.B) {
327 numItems := uint64(1000)

Callers

nothing calls this directly

Calls 4

newSparseBitArrayFunction · 0.85
newBitArrayFunction · 0.85
EqualsMethod · 0.65
SetBitMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…