Skip to content

Commit

Permalink
bloom test correction TestNewBloomFilter account for bitset size change
Browse files Browse the repository at this point in the history
  • Loading branch information
guycipher committed Jan 21, 2025
1 parent b9ccfdf commit 3794875
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bloomfilter/bloomfilter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ func TestNewBloomFilter(t *testing.T) {
if bf.HashCount == 0 {
t.Errorf("Expected non-zero hash count, got %d", bf.HashCount)
}
if len(bf.Bitset) != int(bf.Size) {
t.Errorf("Expected bitset length %d, got %d", bf.Size, len(bf.Bitset))
expectedBitsetLength := (bf.Size + 7) / 8
if len(bf.Bitset) != int(expectedBitsetLength) {
t.Errorf("Expected bitset length %d, got %d", expectedBitsetLength, len(bf.Bitset))
}
if len(bf.hashFuncs) != int(bf.HashCount) {
t.Errorf("Expected hashFuncs length %d, got %d", bf.HashCount, len(bf.hashFuncs))
Expand Down

0 comments on commit 3794875

Please sign in to comment.