extend("test")
extend("array")
extend("string")

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

  it("appends an integer to an int array", () => {
    expect_equal(
      array:append(4, [1,2,3]),
      [1,2,3,4]
    )
  })

  it("works with partial usage for the item", () => {
    adder = array:append(_, [10,20])
    expect_equal(
      adder(30),
      [10,20,30]
    )
  })

  it("works with partial usage for the array", () => {
    partial = array:append("X")
    expect_equal(
      partial(["A","B"]),
      ["A","B","X"]
    )
  })

  it("concatenates two single strings if second arg is a string", () => {
    expect_equal(
      array:append("World!", "Hello, "),
      "Hello, World!"
    )
  })

})
