miller/pkg/bifs/bits_test.go
John Kerl 268a96d002
Export library code in pkg/ (#1391)
* Export library code in `pkg/`

* new doc page
2023-09-10 17:15:13 -04:00

19 lines
401 B
Go

package bifs
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/johnkerl/miller/pkg/mlrval"
)
func TestBIF_bitcount(t *testing.T) {
input1 := mlrval.FromDeferredType("0xcafe")
output := BIF_bitcount(input1)
intval, ok := output.GetIntValue()
assert.True(t, ok)
assert.Equal(t, int64(11), intval)
}
// TODO: copy in more unit-test cases from existing regression-test data