todo-server/server/ajax/form/uuid_test.go

21 lines
293 B
Go

package form
import (
"strconv"
"testing"
)
func TestUUID(t *testing.T) {
seen := map[string]struct{}{}
for i := 0; i < 50; i++ {
v := NewUUID()
if _, ok := seen[v]; ok {
t.Error(ok)
}
if _, err := strconv.Atoi(v); err != nil {
t.Error(err)
}
seen[v] = struct{}{}
}
}