mirror of
https://git.sr.ht/~joren/streamrip-go
synced 2026-06-17 23:25:30 +02:00
23 lines
528 B
Go
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)
|
|
}
|
|
}
|