random_test.go 213 B

123456789101112131415
  1. package util
  2. import (
  3. "fmt"
  4. "testing"
  5. )
  6. func TestRandNumString(t *testing.T) {
  7. expectSize := 6
  8. salt := RandNumString(expectSize)
  9. fmt.Println(salt)
  10. if len(salt) != expectSize {
  11. t.Fatal("wrong size")
  12. }
  13. }