aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app/username_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-10-29 03:40:09 +0900
committerOphestra <cat@gensokyo.uk>2025-10-29 03:40:09 +0900
commit274686d10d3386a41f8fb6bc3363269a734afe0e (patch)
tree59ce81d5617cf5e1f67b819dab49b83b71d8ff93 /internal/app/username_test.go
parent65342d588ff061d2130e6379d86a26be90c908ae (diff)
internal/validate: relocate from app
These are free of the dispatcher from internal/app. This change relocates them into their own package. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/username_test.go')
-rw-r--r--internal/app/username_test.go28
1 files changed, 0 insertions, 28 deletions
diff --git a/internal/app/username_test.go b/internal/app/username_test.go
deleted file mode 100644
index 1b2e0459..00000000
--- a/internal/app/username_test.go
+++ /dev/null
@@ -1,28 +0,0 @@
-package app
-
-import (
- "strings"
- "testing"
-)
-
-func TestIsValidUsername(t *testing.T) {
- t.Parallel()
-
- t.Run("long", func(t *testing.T) {
- if isValidUsername(strings.Repeat("a", sysconf(_SC_LOGIN_NAME_MAX))) {
- t.Errorf("isValidUsername unexpected true")
- }
- })
-
- t.Run("regexp", func(t *testing.T) {
- if isValidUsername("0") {
- t.Errorf("isValidUsername unexpected true")
- }
- })
-
- t.Run("valid", func(t *testing.T) {
- if !isValidUsername("alice") {
- t.Errorf("isValidUsername unexpected false")
- }
- })
-}