initial Go port of streamrip

This commit is contained in:
2026-04-19 21:11:38 +02:00
commit 97e8b758b3
32 changed files with 7008 additions and 0 deletions

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