| 487 | } |
| 488 | |
| 489 | func 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 | |
| 504 | func TestSetRand(t *testing.T) { |
| 505 | myString := "805-9dd6-1a877cb526c678e71d38-7122-44c0-9b7c-04e7001cc78783ac3e82-47a3-4cc3-9951-13f3339d88088f5d685a-11f7-4078-ada9-de44ad2daeb7" |