Files

25 lines
680 B
Go
Raw Permalink Normal View History

package common
import "testing"
func TestIsValidAccountPassword(t *testing.T) {
tests := []struct {
name string
password string
want bool
}{
{name: "five characters", password: "12345", want: false},
{name: "six digits", password: "123456", want: true},
{name: "six letters without complexity", password: "abcdef", want: true},
{name: "six unicode characters", password: "密码密码密码", want: true},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
if got := IsValidAccountPassword(test.password); got != test.want {
t.Fatalf("IsValidAccountPassword(%q) = %v, want %v", test.password, got, test.want)
}
})
}
}