Files
streamrip-go/internal/naming/naming_test.go
2026-04-19 21:11:38 +02:00

23 lines
528 B
Go

package naming
import "testing"
func TestFormatTemplate(t *testing.T) {
got := FormatTemplate("{tracknumber:02}. {artist} - {title}{explicit}", map[string]string{
"tracknumber": "3",
"artist": "Fleetwood Mac",
"title": "Dreams",
"explicit": "",
})
if got != "03. Fleetwood Mac - Dreams" {
t.Fatalf("got %q", got)
}
}
func TestCleanName(t *testing.T) {
got := CleanName(" Dreams/Live ", Config{RestrictCharacters: false, TruncateTo: 120})
if got != "Dreams_Live" {
t.Fatalf("got %q", got)
}
}