Xinwei Xiong(cubxxw-openim) 6d499032fa v3 - main to cut out
2023-06-29 22:35:31 +08:00

16 lines
246 B
Go

package utils
import "testing"
func TestGenID(t *testing.T) {
m := map[string]struct{}{}
for i := 0; i < 2000; i++ {
got := GenID()
if _, ok := m[got]; !ok {
m[got] = struct{}{}
} else {
t.Error("id generate error", got)
}
}
}