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

Function TestBadRand

uuid_test.go:489–502  ·  uuid_test.go::TestBadRand
(t *testing.T)

Source from the content-addressed store, hash-verified

487}
488
489func TestBadRand(t *testing.T) {
490 SetRand(badRand{})
491 uuid1 := New()
492 uuid2 := New()
493 if uuid1 != uuid2 {
494 t.Errorf("expected duplicates, got %q and %q", uuid1, uuid2)
495 }
496 SetRand(nil)
497 uuid1 = New()
498 uuid2 = New()
499 if uuid1 == uuid2 {
500 t.Errorf("unexpected duplicates, got %q", uuid1)
501 }
502}
503
504func TestSetRand(t *testing.T) {
505 myString := "805-9dd6-1a877cb526c678e71d38-7122-44c0-9b7c-04e7001cc78783ac3e82-47a3-4cc3-9951-13f3339d88088f5d685a-11f7-4078-ada9-de44ad2daeb7"

Callers

nothing calls this directly

Calls 2

SetRandFunction · 0.85
NewFunction · 0.85

Tested by

no test coverage detected