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

Function TestSetRand

uuid_test.go:504–521  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

502}
503
504func TestSetRand(t *testing.T) {
505 myString := "805-9dd6-1a877cb526c678e71d38-7122-44c0-9b7c-04e7001cc78783ac3e82-47a3-4cc3-9951-13f3339d88088f5d685a-11f7-4078-ada9-de44ad2daeb7"
506
507 SetRand(strings.NewReader(myString))
508 uuid1 := New()
509 uuid2 := New()
510
511 SetRand(strings.NewReader(myString))
512 uuid3 := New()
513 uuid4 := New()
514
515 if uuid1 != uuid3 {
516 t.Errorf("expected duplicates, got %q and %q", uuid1, uuid3)
517 }
518 if uuid2 != uuid4 {
519 t.Errorf("expected duplicates, got %q and %q", uuid2, uuid4)
520 }
521}
522
523func TestRandomFromReader(t *testing.T) {
524 myString := "8059ddhdle77cb52"

Callers

nothing calls this directly

Calls 2

SetRandFunction · 0.85
NewFunction · 0.85

Tested by

no test coverage detected