extend("test")
extend("array")
describe("array:partition", () => {
it("splits by predicate", () => {
res = array:partition(x => x % 2 == 0, [1,2,3,4,5])
expect_equal(res, [[2,4],[1,3,5]])
})
it("partial usage", () => {
evenPart = array:partition(x => x % 2 == 0)
expect_equal(evenPart([2,2,1]), [[2,2],[1]])
})
})