Skip to content

Commit 213dc71

Browse files
committed
test: remove random string test
1 parent 698b50f commit 213dc71

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

random/random_test.go

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package random
22

33
import (
4-
"math/rand"
54
"regexp"
65
"testing"
76

@@ -11,20 +10,8 @@ import (
1110
func Test(t *testing.T) {
1211
assert.Len(t, String(32), 32)
1312
r := New()
14-
assert.Regexp(t, regexp.MustCompile("[0-9]+$"), r.String(8, Numeric))
15-
}
16-
17-
func TestRandomString(t *testing.T) {
18-
r := New()
19-
// overwrite initialized Source by New()
20-
rand.Seed(1)
21-
22-
got := r.String(32, Alphanumeric)
23-
str := "onrHFkSuohOf8IvDIjS5HUHTGvw8q5mt"
24-
25-
if got == str {
26-
t.Errorf("want random string; got: %s\n", got)
27-
}
13+
want := r.String(8, Numeric)
14+
assert.Regexp(t, regexp.MustCompile("[0-9]+$"), want)
2815
}
2916

3017
func BenchmarkRandomString(b *testing.B) {

0 commit comments

Comments
 (0)