go-i18n/classify_test.go
Snider a5f3eb4777 feat: add classify types and token-to-domain mapper
Co-Authored-By: Virgil <virgil@lethean.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 00:03:25 +00:00

34 lines
723 B
Go

package i18n
import "testing"
func TestMapTokenToDomain(t *testing.T) {
tests := []struct {
token string
want string
}{
{"technical", "technical"},
{"Technical", "technical"},
{"tech", "technical"},
{"creative", "creative"},
{"Creative", "creative"},
{"cre", "creative"},
{"ethical", "ethical"},
{"Ethical", "ethical"},
{"eth", "ethical"},
{"casual", "casual"},
{"Casual", "casual"},
{"cas", "casual"},
{"unknown", "unknown"},
{"", "unknown"},
{"foo", "unknown"},
}
for _, tt := range tests {
t.Run(tt.token, func(t *testing.T) {
got := mapTokenToDomain(tt.token)
if got != tt.want {
t.Errorf("mapTokenToDomain(%q) = %q, want %q", tt.token, got, tt.want)
}
})
}
}