rony-chat-bot/internal/i18n/i18n_test.go

24 lines
568 B
Go
Raw Normal View History

package i18n
import "testing"
func TestDetect(t *testing.T) {
cases := []struct {
in, want string
}{
{"Hola, ¿qué proyectos tienes?", "es"},
{"háblame de rony-llm-agent", "es"},
{"¿cuáles son tus skills?", "es"},
{"What projects do you have?", "en"},
{"Tell me about rony-llm-agent", "en"},
{"How does the chat bot work?", "en"},
{"lorem ipsum dolor sit amet", "en"}, // no markers → en
{"", "en"},
}
for _, c := range cases {
got := Detect(c.in)
if got != c.want {
t.Errorf("Detect(%q) = %q, want %q", c.in, got, c.want)
}
}
}