package dns import "testing" func TestExtractUsernameSimple(t *testing.T) { username := ExtractUsername( "pages.local", "papatutuwawa.pages.local", ) if username != "papatutuwawa" { t.Fatalf("Unexpected username: '%s'", username) } } func TestExtractUsernameDot(t *testing.T) { username := ExtractUsername( "pages.local", "polynom.me.pages.local", ) if username != "polynom.me" { t.Fatalf("Unexpected username: '%s'", username) } }