diff options
author | 2024-10-05 20:37:30 -0700 | |
---|---|---|
committer | 2024-10-05 21:21:12 -0700 | |
commit | e555e442fba0a9ca3c8cf67444e8c42f79db359a (patch) | |
tree | e7ee91ff4842ef23569833e0443be91545d4c42e /internal/validator/validator_test.go | |
parent | 600dea6ce54989a792e666a0a26de0ee847e4562 (diff) | |
download | v2-e555e442fba0a9ca3c8cf67444e8c42f79db359a.tar.gz v2-e555e442fba0a9ca3c8cf67444e8c42f79db359a.tar.zst v2-e555e442fba0a9ca3c8cf67444e8c42f79db359a.zip |
feat: add new settings option to allow external fonts
Diffstat (limited to 'internal/validator/validator_test.go')
-rw-r--r-- | internal/validator/validator_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/validator/validator_test.go b/internal/validator/validator_test.go index 0a51973b..7121a111 100644 --- a/internal/validator/validator_test.go +++ b/internal/validator/validator_test.go @@ -59,3 +59,21 @@ func TestIsValidRegex(t *testing.T) { } } } + +func TestIsValidDomain(t *testing.T) { + scenarios := map[string]bool{ + "example.org": true, + "example": false, + "example.": false, + "example..": false, + "mail.example.com:443": false, + "*.example.com": false, + } + + for domain, expected := range scenarios { + result := IsValidDomain(domain) + if result != expected { + t.Errorf(`Unexpected result, got %v instead of %v`, result, expected) + } + } +} |