array-mumu 0.2.0-rc.5

Array tools plugin for the Mumu ecosystem
Documentation
extend("test")
extend("array")

describe("array:collect", () => {

  it("returns the same array for int arrays", () => {
    data = [1,2,3]
    out = array:collect(data)
    expect_equal(type(out), "int_array")
    expect_equal(out, [1,2,3])
  })

  it("collects a core step iterator into an int array", () => {
    range = step(0, 5)
    out = array:collect(range)
    expect_equal(type(out), "int_array")
    expect_equal(out, [0,1,2,3,4])
  })

  it("propagates errors for unsupported input types", () => {
    test:expect_error(() => array:collect(123))
  })

})