mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-24 01:30:25 +08:00
ae87114282
* chore: change interface{} to any * chore: update goctl version to 1.5.0 * chore: update goctl deps
18 lines
272 B
Go
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)
|
|
}
|