feat: add personal playlists and shareable track links
EOF Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
3a097c15c8
commit
fa79394869
46 files changed
+2307
-292
No files matched your search
@@ -0,0 +1,21 @@
|
||||
package playback
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestValidatePlaylist(t *testing.T) {
|
||||
id := uuid.New()
|
||||
require.NoError(t, validatePlaylist(" В дорогу ", "", []uuid.UUID{id}))
|
||||
require.NoError(t, validatePlaylist(strings.Repeat("я", 120), strings.Repeat("я", 2000), nil))
|
||||
for _, name := range []string{"", " \t\n", strings.Repeat("я", 121)} {
|
||||
require.Error(t, validatePlaylist(name, "", nil))
|
||||
}
|
||||
require.Error(t, validatePlaylist("Mix", strings.Repeat("я", 2001), nil))
|
||||
require.Error(t, validatePlaylist("Mix", "", []uuid.UUID{id, id}))
|
||||
require.Error(t, validatePlaylist("Mix", "", []uuid.UUID{uuid.Nil}))
|
||||
require.Error(t, validatePlaylist("Mix", "", make([]uuid.UUID, 2001)))
|
||||
}
|
||||
Reference in new issue
Block a user