Skip to content

Commit

Permalink
leading_zeros_test.go tests for go1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
skullhole committed Aug 24, 2024
1 parent 630b883 commit 04f7f9a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions leading_zeros_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//go:build !go1.9
// +build !go1.9

package bitset

import (
"testing"
)

func TestLen64(t *testing.T) {
for i := 0; i < 64; i++ {
received := len64(uint64(1) << i)
expected := uint(i + 1)
if received != expected {
t.Errorf("len64(%b) is incorrect: received %d, expected %d", uint64(1)<<i, received, expected)
}
}
}

0 comments on commit 04f7f9a

Please sign in to comment.