random_test.go 230 B

1234567891011121314
  1. package random
  2. import (
  3. "regexp"
  4. "testing"
  5. "github.com/stretchr/testify/assert"
  6. )
  7. func Test(t *testing.T) {
  8. assert.Len(t, String(32), 32)
  9. r := New()
  10. assert.Regexp(t, regexp.MustCompile("[0-9]+$"), r.String(8, Numeric))
  11. }