go-zero/core/mathx/entropy_test.go
Kevin Wan ae87114282
chore: change interface{} to any (#2818)
* chore: change interface{} to any

* chore: update goctl version to 1.5.0

* chore: update goctl deps
2023-01-24 16:32:02 +08:00

18 lines
272 B
Go

package mathx
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestCalcEntropy(t *testing.T) {
const total = 1000
const count = 100
m := make(map[any]int, total)
for i := 0; i < total; i++ {
m[i] = count
}
assert.True(t, CalcEntropy(m) > .99)
}