diff --git a/leading_zeros_test.go b/leading_zeros_test.go new file mode 100644 index 0000000..7c2b1ec --- /dev/null +++ b/leading_zeros_test.go @@ -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)<