Files
go2tv/soapcalls/utils/urlencoder_test.go
2023-05-01 19:48:14 +03:00

34 lines
534 B
Go

package utils
import (
"testing"
)
func TestCovertFilename(t *testing.T) {
tt := []struct {
name string
input string
want string
}{
{
`Test #1`,
`something & something.mp4`,
`something%20%26%20something.mp4`,
},
{
`Test #2`,
`something + something.mp4`,
`something%20%2B%20something.mp4`,
},
}
for _, tc := range tt {
t.Run(tc.name, func(t *testing.T) {
out := ConvertFilename(tc.input)
if out != tc.want {
t.Fatalf("%s: got: %s, want: %s.", tc.name, out, tc.want)
}
})
}
}