Files
QTransfer/internal/match/matcher_test.go
2026-04-03 21:26:08 +02:00

29 lines
595 B
Go

package match
import (
"strings"
"testing"
"qtransfer/internal/model"
)
func TestNormalizeTransliteratesCyrillic(t *testing.T) {
got := normalize("детство")
if got != "detstvo" {
t.Fatalf("expected detstvo, got %q", got)
}
}
func TestBuildQueriesIncludesLatinVariant(t *testing.T) {
m := &Matcher{}
q := m.buildQueries(model.Track{
Title: "детство",
Artists: []string{"Rauf & Faik"},
})
joined := strings.Join(q, "\n")
if !strings.Contains(strings.ToLower(joined), "detstvo") {
t.Fatalf("expected transliterated query to include detstvo, got %v", q)
}
}