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)
	}
}
