Add ability to reorder playlist items
This commit is contained in:
@@ -48,4 +48,16 @@ var _ = Describe("Strings", func() {
|
||||
Expect(StringInSlice("bbb", []string{"bbb", "aaa", "ccc"})).To(BeTrue())
|
||||
})
|
||||
})
|
||||
|
||||
Describe("MoveString", func() {
|
||||
It("moves item to end of slice", func() {
|
||||
Expect(MoveString([]string{"1", "2", "3"}, 0, 2)).To(ConsistOf("2", "3", "1"))
|
||||
})
|
||||
It("moves item to beginning of slice", func() {
|
||||
Expect(MoveString([]string{"1", "2", "3"}, 2, 0)).To(ConsistOf("3", "1", "2"))
|
||||
})
|
||||
It("keeps item in same position if srcIndex == dstIndex", func() {
|
||||
Expect(MoveString([]string{"1", "2", "3"}, 1, 1)).To(ConsistOf("1", "2", "3"))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user