diff --git a/random/random_test.go b/random/random_test.go index 853fc83..13ac93a 100644 --- a/random/random_test.go +++ b/random/random_test.go @@ -1,7 +1,6 @@ package random import ( - "math/rand" "regexp" "testing" @@ -11,20 +10,8 @@ import ( func Test(t *testing.T) { assert.Len(t, String(32), 32) r := New() - assert.Regexp(t, regexp.MustCompile("[0-9]+$"), r.String(8, Numeric)) -} - -func TestRandomString(t *testing.T) { - r := New() - // overwrite initialized Source by New() - rand.Seed(1) - - got := r.String(32, Alphanumeric) - str := "onrHFkSuohOf8IvDIjS5HUHTGvw8q5mt" - - if got == str { - t.Errorf("want random string; got: %s\n", got) - } + want := r.String(8, Numeric) + assert.Regexp(t, regexp.MustCompile("[0-9]+$"), want) } func BenchmarkRandomString(b *testing.B) {