extend("test")
extend("math")

describe("math:plus usage", () => {
  it("should add two single integers", () => {
    expect_equal( math:plus(3, 4), 7 )
  })

  it("should handle partial usage for one integer", () => {
    ten = math:plus(10)
    expect_equal( ten(5), 15 )
  })

  it("should handle placeholder with single integer", () => {
    two = math:plus(_, 2)
    expect_equal( two(10), 12 )
  })

  it("should add a single int to an int array", () => {
    expect_equal(
      math:plus(5, [10,20,30]),
      [15,25,35]
    )
  })

  it("should do partial usage with an array", () => {
    ten = math:plus(10)
    expect_equal(
      ten([1,2,3]),
      [11,12,13]
    )
  })

  it("should handle placeholder with an array", () => {
    tenTwenty = math:plus(_, [10,20])
    expect_equal(
      tenTwenty(100),
      [110,120]
    )
  })

  it("should add an array to a single int (switched side)", () => {
    expect_equal(
      math:plus([2,3,4], 10),
      [12,13,14]
    )
  })
})

