Add TOP-100 playlist

This commit is contained in:
nxshock 2021-11-02 16:13:23 +05:00
parent c6346cadbf
commit f9fe602c15
4 changed files with 68 additions and 7 deletions

23
parser_test.go Normal file
View file

@ -0,0 +1,23 @@
package main
import (
"net/url"
"testing"
"github.com/stretchr/testify/assert"
)
func TestConstructURL(t *testing.T) {
tests := []struct {
params url.Values
expected string
}{
{nil, "https://promodj.com/music/testGenre"},
{url.Values{"download": []string{"1"}}, "https://promodj.com/music/testGenre?download=1"},
{url.Values{"download": []string{"1"}, "page": []string{"1"}}, "https://promodj.com/music/testGenre?download=1&page=1"},
}
for _, test := range tests {
assert.Equal(t, test.expected, constructUrl("testGenre", test.params))
}
}