def test_basic_execution(cx): t.eq(cx.execute("var x = 4; x * x;"), 16) t.lt(cx.execute("22/7;") - 3.14285714286, 0.00000001)
def test_compiled_execution(cx): expr1 = cx.compile("var x = 4; x * x;") print type(expr1) t.eq(expr1.execute(), 16) expr2 = cx.compile("22/7;") t.lt(expr2.execute() - 3.14285714286, 0.00000001)