def test_basic_operations(TestObj):
    """Test the var operations.

    Args:
        TestObj: The test object.
    """
    assert str(v(1) == v(2)) == "(1 === 2)"
    assert str(v(1) != v(2)) == "(1 !== 2)"
    assert str(LiteralNumberVar.create(1) < 2) == "(1 < 2)"
    assert str(LiteralNumberVar.create(1) <= 2) == "(1 <= 2)"
    assert str(LiteralNumberVar.create(1) > 2) == "(1 > 2)"
    assert str(LiteralNumberVar.create(1) >= 2) == "(1 >= 2)"
    assert str(LiteralNumberVar.create(1) + 2) == "(1 + 2)"
    assert str(LiteralNumberVar.create(1) - 2) == "(1 - 2)"
    assert str(LiteralNumberVar.create(1) * 2) == "(1 * 2)"
    assert str(LiteralNumberVar.create(1) / 2) == "(1 / 2)"
    assert str(LiteralNumberVar.create(1) // 2) == "Math.floor(1 / 2)"
    assert str(LiteralNumberVar.create(1) % 2) == "(1 % 2)"
    assert str(LiteralNumberVar.create(1) ** 2) == "(1 ** 2)"
    assert str(LiteralNumberVar.create(1) & v(2)) == "(1 && 2)"
    assert str(LiteralNumberVar.create(1) | v(2)) == "(1 || 2)"
    assert str(LiteralArrayVar.create([1, 2, 3])[0]) == "[1, 2, 3].at(0)"
    assert (
        str(LiteralObjectVar.create({"a": 1, "b": 2})["a"])
        == '({ ["a"] : 1, ["b"] : 2 })["a"]'
    )
    assert str(v("foo") == v("bar")) == '("foo" === "bar")'
    assert str(Var(_js_expr="foo") == Var(_js_expr="bar")) == "(foo === bar)"
    assert (
        str(LiteralVar.create("foo") == LiteralVar.create("bar")) == '("foo" === "bar")'
    )
    print(Var(_js_expr="foo").to(ObjectVar, TestObj)._var_set_state("state"))
    assert (
        str(
            Var(_js_expr="foo").to(ObjectVar, TestObj)._var_set_state("state").bar
            == LiteralVar.create("bar")
        )
        == '(state.foo["bar"] === "bar")'
    )
    assert (
        str(Var(_js_expr="foo").to(ObjectVar, TestObj)._var_set_state("state").bar)
        == 'state.foo["bar"]'
    )
    assert str(abs(LiteralNumberVar.create(1))) == "Math.abs(1)"
    assert str(LiteralArrayVar.create([1, 2, 3]).length()) == "[1, 2, 3].length"
    assert (
        str(LiteralArrayVar.create([1, 2]) + LiteralArrayVar.create([3, 4]))
        == "[...[1, 2], ...[3, 4]]"
    )

    # Tests for reverse operation
    assert (
        str(LiteralArrayVar.create([1, 2, 3]).reverse())
        == "[1, 2, 3].slice().reverse()"
    )
    assert (
        str(LiteralArrayVar.create(["1", "2", "3"]).reverse())
        == '["1", "2", "3"].slice().reverse()'
    )
    assert (
        str(Var(_js_expr="foo")._var_set_state("state").to(list).reverse())
        == "state.foo.slice().reverse()"
    )
    assert str(Var(_js_expr="foo").to(list).reverse()) == "foo.slice().reverse()"
    assert str(Var(_js_expr="foo", _var_type=str).js_type()) == "(typeof(foo))"
Test the var operations.

    Args:
        TestObj: The test object.
    
tests/units/test_var.py