mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-06 01:07:06 +08:00
15 lines
257 B
Go
15 lines
257 B
Go
package sortedset
|
|
|
|
import "testing"
|
|
|
|
func TestRandomLevel(t *testing.T) {
|
|
m := make(map[int16]int)
|
|
for i := 0; i < 10000; i++ {
|
|
level := randomLevel()
|
|
m[level]++
|
|
}
|
|
for i := 0; i <= maxLevel; i++ {
|
|
t.Logf("level %d, count %d", i, m[int16(i)])
|
|
}
|
|
}
|