def test_expr(self): parse(f'print(2 / 3 - 1)').should.contain( Print(Sub(Div(Integer(2), Integer(3)), Integer(1))))
def test_expr_with_parenthesis(self): parse(f'print(2 / (3 - 1))').should.contain( Print(Div(Integer(2), Sub(Integer(3), Integer(1)))))
def test_float(self): float_ = 0.42 parse(f'print({float_})').should.contain(Print(Float(float_)))
def test_int(self): integer = 42 parse(f'print({integer})').should.contain(Print(Integer(integer)))
def test_strings(self): string = "howdy ho" parse(f'print(\'{string}\')').should.contain(Print(String(string)))
def test_can_be_compared(self): Print(Integer(10)).should.be.equal(Print(Integer(10))) Print(Integer(10)).should_not.be.equal(Print(Integer(11)))
def print(self, expr): return Print(expr)