add support for underscore in the app name

This commit is contained in:
Yuli
2020-03-21 21:14:33 +02:00
parent 4ae08dc833
commit eb749ec842

View File

@@ -24,19 +24,18 @@ func Test_UUID(t *testing.T) {
}
func Test_AppNames(t *testing.T) {
goodApps := []string{"penn", "teller", "a123"}
goodApps := []string{"penn", "teller", "a123", "good_app"}
for _, value := range goodApps {
if isValidApp(value) == false {
t.Fatalf("Failed to validate good app name: %s ", value)
}
}
badApps := []string{"P1", "1as", "_a", "a_a", "a.a", "a a"}
badApps := []string{"P1", "4as", "_a", "a.a", "a a", "a!b"}
for _, value := range badApps {
if isValidApp(value) == true {
t.Fatalf("Failed to validate bad app name: %s ", value)
}
}
}
func Test_stringPatternMatch(t *testing.T) {