Call ffmpeg in batches

This commit is contained in:
Deluan
2020-06-11 17:36:09 -04:00
committed by Deluan Quintão
parent 6a3dabbb06
commit 3190611ec8
4 changed files with 75 additions and 36 deletions
+21
View File
@@ -60,4 +60,25 @@ var _ = Describe("Strings", func() {
Expect(MoveString([]string{"1", "2", "3"}, 1, 1)).To(ConsistOf("1", "2", "3"))
})
})
Describe("BreakUpStringSlice", func() {
It("returns no chunks if slice is empty", func() {
var slice []string
chunks := BreakUpStringSlice(slice, 10)
Expect(chunks).To(HaveLen(0))
})
It("returns the slice in one chunk if len < chunkSize", func() {
slice := []string{"a", "b", "c"}
chunks := BreakUpStringSlice(slice, 10)
Expect(chunks).To(HaveLen(1))
Expect(chunks[0]).To(ConsistOf("a", "b", "c"))
})
It("breaks up the slice if len > chunkSize", func() {
slice := []string{"a", "b", "c", "d", "e"}
chunks := BreakUpStringSlice(slice, 3)
Expect(chunks).To(HaveLen(2))
Expect(chunks[0]).To(ConsistOf("a", "b", "c"))
Expect(chunks[1]).To(ConsistOf("d", "e"))
})
})
})