Skip to content

Commit

Permalink
test: remove random string test
Browse files Browse the repository at this point in the history
  • Loading branch information
ichigozero committed Aug 12, 2023
1 parent 698b50f commit 213dc71
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions random/random_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package random

import (
"math/rand"
"regexp"
"testing"

Expand All @@ -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) {
Expand Down

0 comments on commit 213dc71

Please # to comment.