extend("test")

describe("Supported operators in the core", () => {

  it("should suport basic arithmetic operators", () => {
    expect_equal(1 + 2, 3)
    expect_equal(10 - 5, 5)
    expect_equal(2 * 3, 6)
    expect_equal(8 / 2, 4)
    expect_equal(5 % 2, 1)
    expect_equal(-5, -5)
    expect_equal(-(1 + 2), -3)
  })

  it("should support common comparison operators", () => {
    expect_equal(1 < 2, true)
    expect_equal(1 <= 1, true)
    expect_equal(2 > 1, true)
    expect_equal(2 >= 2, true)
    expect_equal(1 == 1, true)
    expect_equal(1 != 2, true)
    expect_equal(1 == 2, false)
    expect_equal(5 >= 6, false)
  })

  it("should supoprt common operators", () => {
    expect_equal(true && false, false)
    expect_equal(true || false, true)
    expect_equal(!true, false)
    expect_equal(!false, true)
  })

  it("shoud support basic ternary operator usage", () => {
    expect_equal( 4 == 6 ? "four is six" : "four is not six", "four is not six" )
    expect_equal( 1 == 1 ? 123 : 999, 123 )
    expect_equal( false ? 10 : 20, 20 )
    expect_equal( (2 < 3 ? "OK" : "NotOK"), "OK" )
  })

  it("shoud supprt common bitwise and shift operators", () => {
    expect_equal(5 & 3, 1)
    expect_equal(5 | 3, 7)
    expect_equal(5 ^ 3, 6)
    expect_equal(1 << 3, 8)
    expect_equal(16 >> 2, 4)
  })
})


