diff options
Diffstat (limited to 'playlist_test.go')
| -rw-r--r-- | playlist_test.go | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/playlist_test.go b/playlist_test.go index 2ccad7c..8730737 100644 --- a/playlist_test.go +++ b/playlist_test.go @@ -5,7 +5,7 @@ import "testing" func TestPlAdd(t *testing.T) { var pl Playlist s := NewDummySong("Foo", "Bar") - pl.Add(&s) + pl.Add(s) if len(pl) != 1 { t.Log("len should be 1") t.Fail() @@ -15,7 +15,7 @@ func TestPlAdd(t *testing.T) { func TestPlAddPop(t *testing.T) { var pl Playlist s := NewDummySong("Foo", "Bar") - pl.Add(&s) + pl.Add(s) if len(pl) != 1 { t.Log("len should be 1") t.Fail() @@ -27,7 +27,7 @@ func TestPlAddPop(t *testing.T) { t.Fail() } - if ps != &s { + if ps != s { t.Log("the popped ptr should match the one added") t.Fail() } @@ -37,8 +37,8 @@ func TestPlAddPopTwice(t *testing.T) { var pl Playlist s1 := NewDummySong("Foo", "Bar") s2 := NewDummySong("Nasen", "Baer") - pl.Add(&s1) - pl.Add(&s2) + pl.Add(s1) + pl.Add(s2) if len(pl) != 2 { t.Log("len should be 2") t.Fail() @@ -51,12 +51,12 @@ func TestPlAddPopTwice(t *testing.T) { t.Fail() } - if ps1 != &s1 { + if ps1 != s1 { t.Log("the popped ptr should match the one added") t.Fail() } - if ps2 != &s2 { + if ps2 != s2 { t.Log("the popped ptr should match the one added") t.Fail() } @@ -66,15 +66,15 @@ func TestPlAdd2AdjustPop(t *testing.T) { var pl Playlist s1 := NewDummySong("Foo", "Bar") s2 := NewDummySong("Nasen", "Baer") - pl.Add(&s1) - pl.Add(&s2) + pl.Add(s1) + pl.Add(s2) if len(pl) != 2 { t.Log("len should be 2") t.Fail() } s2.Weight += 1 - pl.Adjust(&s2) + pl.Adjust(s2) ps := pl.PopSong() if len(pl) != 1 { @@ -82,7 +82,7 @@ func TestPlAdd2AdjustPop(t *testing.T) { t.Fail() } - if ps != &s2 { + if ps != s2 { t.Log("the popped ptr should match the one adjusted") t.Fail() } @@ -93,9 +93,9 @@ func TestPlAdd3AdjustAdjustPop(t *testing.T) { s1 := NewDummySong("Foo", "Bar") s2 := NewDummySong("Nasen", "Baer") s3 := NewDummySong("Hut", "Traeger") - pl.Add(&s1) - pl.Add(&s2) - pl.Add(&s3) + pl.Add(s1) + pl.Add(s2) + pl.Add(s3) if len(pl) != 3 { t.Log("len should be 3") @@ -103,13 +103,13 @@ func TestPlAdd3AdjustAdjustPop(t *testing.T) { } s1.Weight += 1 - pl.Adjust(&s1) + pl.Adjust(s1) s2.Weight -= 1 - pl.Adjust(&s2) + pl.Adjust(s2) s3.Weight += 1 - pl.Adjust(&s3) + pl.Adjust(s3) ps := pl.PopSong() if len(pl) != 2 { @@ -117,7 +117,7 @@ func TestPlAdd3AdjustAdjustPop(t *testing.T) { t.Fail() } - if ps == &s2 { + if ps == s2 { t.Log("the popped ptr is the downvoted one") t.Fail() } @@ -128,7 +128,7 @@ func TestPlAdd3AdjustAdjustPop(t *testing.T) { t.Fail() } - if ps == &s2 { + if ps == s2 { t.Log("the popped ptr is the downvoted one") t.Fail() } |
