mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
16 lines
246 B
Go
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)
|
|
}
|
|
}
|
|
}
|