def test_ITE(): expr = ITE(x < 1, y, z) assert rust_code(expr) == ("if (x < 1) {\n" " y\n" "} else {\n" " z\n" "}")
def test_ITE(): expr = ITE(x < 1, x, x + 2) assert rust_code(expr) == ("if (x < 1) {\n" " x\n" "} else {\n" " x + 2\n" "}")
def test_ccode_ITE(): expr = ITE(x < 1, y, z) assert ccode(expr) == ("((x < 1) ? (\n" " y\n" ")\n" ": (\n" " z\n" "))")
def test_ccode_ITE(): expr = ITE(x < 1, x, x**2) assert ccode(expr) == ("((x < 1) ? (\n" " x\n" ")\n" ": (\n" " pow(x, 2)\n" "))")
def test_rcode_ITE(): expr = ITE(x < 1, y, z) p = rcode(expr) ref="ifelse(x < 1,y,z)" assert p == ref
def test_rcode_ITE(): expr = ITE(x < 1, x, x**2) p = rcode(expr) ref="ifelse(x < 1,x,x^2)" assert p == ref