MCPcopy
hub / github.com/google/uuid / TestRandomUUID

Function TestRandomUUID

uuid_test.go:168–184  ·  uuid_test.go::TestRandomUUID
(t *testing.T)

Source from the content-addressed store, hash-verified

166}
167
168func TestRandomUUID(t *testing.T) {
169 m := make(map[string]bool)
170 for x := 1; x < 32; x++ {
171 uuid := New()
172 s := uuid.String()
173 if m[s] {
174 t.Errorf("NewRandom returned duplicated UUID %s", s)
175 }
176 m[s] = true
177 if v := uuid.Version(); v != 4 {
178 t.Errorf("Random UUID of version %s", v)
179 }
180 if uuid.Variant() != RFC4122 {
181 t.Errorf("Random UUID is variant %d", uuid.Variant())
182 }
183 }
184}
185
186func TestRandomUUID_Pooled(t *testing.T) {
187 defer DisableRandPool()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
VersionMethod · 0.80
VariantMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected