extend("test")
extend("array")
describe("array:chunk", () => {
it("chunks into equal parts", () => {
expect_equal(array:chunk(2, [1,2,3,4]), [[1,2],[3,4]])
})
it("last chunk may be smaller", () => {
expect_equal(array:chunk(3, [1,2,3,4,5]), [[1,2,3],[4,5]])
})
it("works for strings", () => {
expect_equal(array:chunk(2, ["a","b","c"]), [["a","b"],["c"]])
})
})