mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-19 00:36:38 +00:00
More windows tests
This commit is contained in:
@@ -574,11 +574,15 @@ func TestUsernameValidation(t *testing.T) {
|
||||
{"username_with_newline", "user\nname", true, "invalid characters"},
|
||||
{"reserved_dot", ".", true, "cannot be '.' or '..'"},
|
||||
{"reserved_dotdot", "..", true, "cannot be '.' or '..'"},
|
||||
{"username_with_at_symbol", "user@domain", true, "invalid characters"},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
// Skip hyphen test on Windows - Windows allows usernames starting with hyphens
|
||||
if tt.name == "username_starting_with_hyphen" && runtime.GOOS == "windows" {
|
||||
t.Skip("Windows allows usernames starting with hyphens")
|
||||
}
|
||||
|
||||
err := validateUsername(tt.username)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err, "Should reject invalid username")
|
||||
|
||||
Reference in New Issue
Block a user