chore: initial commit of ai site platform
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
19
platform/internal/userstore/tenant_slug_test.go
Normal file
19
platform/internal/userstore/tenant_slug_test.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package userstore
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestNormalizeTenantSlug(t *testing.T) {
|
||||
ok, err := NormalizeTenantSlug("Aaa-01")
|
||||
if err != nil || ok != "aaa-01" {
|
||||
t.Fatalf("got %q %v", ok, err)
|
||||
}
|
||||
if _, err := NormalizeTenantSlug("api"); err == nil {
|
||||
t.Fatal("api should be reserved")
|
||||
}
|
||||
if _, err := NormalizeTenantSlug("1abc"); err == nil {
|
||||
t.Fatal("must start with letter")
|
||||
}
|
||||
if SuggestTenantSlug("Hello World") != "hello-world" {
|
||||
t.Fatalf("suggest ascii")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user