array-mumu 0.2.0-rc.5

Array tools plugin for the Mumu ecosystem
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
extend("test")
extend("array")

describe("array:shuffle", () => {
  it("shuffles but preserves length and membership", () => {
    src = [1,2,3,4,5]
    sh = array:shuffle(src)
    expect_equal(type(sh), "int_array")
    expect_equal(array:length(sh), 5)
    expect_equal(array:includes(1, sh), true)
    expect_equal(array:includes(5, sh), true)
  })
})