mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-25 08:53:55 +00:00
* JIT mlrval type-interfence: mlrval package * mlrmap refactor * complete merge from #779 * iterating * mlrval/format.go * mlrval/copy.go * bifs/arithmetic_test.go * iterate on bifs/collections_test.go * mlrval_cmp.go * mlrval JSON iterate * iterate applying mlrval refactors to dependent packages * first clean compile in a long while on this branch * results of first post-compile profiling * testing * bugfix in ofmt formatting * bugfix in octal-supporess * go fmt * neaten * regression tests all passing
19 lines
403 B
Go
19 lines
403 B
Go
package bifs
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/johnkerl/miller/internal/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, 11, intval)
|
|
}
|
|
|
|
// TODO: copy in more unit-test cases from existing regression-test data
|