You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
246 B
16 lines
246 B
2 years ago
|
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)
|
||
|
}
|
||
|
}
|
||
|
}
|