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

Function TestRandPool

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

Source from the content-addressed store, hash-verified

542}
543
544func TestRandPool(t *testing.T) {
545 myString := "8059ddhdle77cb52"
546 EnableRandPool()
547 SetRand(strings.NewReader(myString))
548 _, err := NewRandom()
549 if err == nil {
550 t.Errorf("expecting an error as reader has no more bytes")
551 }
552 DisableRandPool()
553 SetRand(strings.NewReader(myString))
554 _, err = NewRandom()
555 if err != nil {
556 t.Errorf("failed generating UUID from a reader")
557 }
558}
559
560func TestWrongLength(t *testing.T) {
561 _, err := Parse("12345")

Callers

nothing calls this directly

Calls 4

EnableRandPoolFunction · 0.85
SetRandFunction · 0.85
NewRandomFunction · 0.85
DisableRandPoolFunction · 0.85

Tested by

no test coverage detected