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")
	}
}
