first commit
This commit is contained in:
28
internal/match/matcher_test.go
Normal file
28
internal/match/matcher_test.go
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user