From 04f7f9a02c43f163c35b05318a6571855e894968 Mon Sep 17 00:00:00 2001 From: Oleg Dyachenko Date: Sat, 24 Aug 2024 20:34:49 +0700 Subject: [PATCH] leading_zeros_test.go tests for go1.8 --- leading_zeros_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 leading_zeros_test.go 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)<