mirror of
https://github.com/netbirdio/ice-old.git
synced 2026-05-22 17:08:24 -07:00
18 lines
302 B
Go
18 lines
302 B
Go
package ice
|
|
|
|
import (
|
|
"regexp"
|
|
"testing"
|
|
)
|
|
|
|
func TestRandSeq(t *testing.T) {
|
|
if len(randSeq(10)) != 10 {
|
|
t.Errorf("randSeq return invalid length")
|
|
}
|
|
|
|
var isLetter = regexp.MustCompile(`^[a-zA-Z]+$`).MatchString
|
|
if !isLetter(randSeq(10)) {
|
|
t.Errorf("randSeq should be AlphaNumeric only")
|
|
}
|
|
}
|