mirror of
https://github.com/nxshock/promodj.git
synced 2025-07-05 00:23:11 +05:00
Add TOP-100 playlist
This commit is contained in:
parent
c6346cadbf
commit
f9fe602c15
4 changed files with 68 additions and 7 deletions
23
parser_test.go
Normal file
23
parser_test.go
Normal 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))
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue