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

Function TestRandomUUID_Pooled

uuid_test.go:186–204  ·  uuid_test.go::TestRandomUUID_Pooled
(t *testing.T)

Source from the content-addressed store, hash-verified

184}
185
186func TestRandomUUID_Pooled(t *testing.T) {
187 defer DisableRandPool()
188 EnableRandPool()
189 m := make(map[string]bool)
190 for x := 1; x < 128; x++ {
191 uuid := New()
192 s := uuid.String()
193 if m[s] {
194 t.Errorf("NewRandom returned duplicated UUID %s", s)
195 }
196 m[s] = true
197 if v := uuid.Version(); v != 4 {
198 t.Errorf("Random UUID of version %s", v)
199 }
200 if uuid.Variant() != RFC4122 {
201 t.Errorf("Random UUID is variant %d", uuid.Variant())
202 }
203 }
204}
205
206func TestNew(t *testing.T) {
207 m := make(map[UUID]bool)

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected