mirror of
https://github.com/johnkerl/miller.git
synced 2026-01-23 02:14:13 +00:00
19 lines
401 B
Go
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
|