![]() |
git.alexw.nyc | home | about | git | garden |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | package main import "testing" func TestIsOKUsername(t *testing.T) { for _, u := range []string{"www", "proxy", "%", "", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"} { if isOkUsername(u) == nil { t.Errorf("Username " + u + " should be considered invalid, but wasn't") } } for _, u := range []string{"-", "alex", "1"} { if isOkUsername(u) != nil { t.Errorf("Username " + u + " should be considered valid, but wasn't") } } } |