mirror of
https://git.sr.ht/~joren/streamrip-go
synced 2026-06-17 15:05:39 +02:00
initial Go port of streamrip
This commit is contained in:
22
internal/naming/naming_test.go
Normal file
22
internal/naming/naming_test.go
Normal file
@@ -0,0 +1,22 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user