first commit

This commit is contained in:
joren
2026-04-03 21:26:08 +02:00
commit f7805ddfd8
20 changed files with 6033 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
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)
}
}