예제 #1
0
 def test_minus(self):
     assert parser.parse(lexer.lex('1 -  1')).eval() == 0
예제 #2
0
 def test_sum(self):
     assert parser.parse(lexer.lex(' 1 + 1')).eval() == 2
예제 #3
0
 def test_concat(self):
     assert parser.parse(lexer.lex('"a" + "b"')).eval() == "ab"
예제 #4
0
 def test_open_param(self):
     assert parser.parse(lexer.lex('(1 + 2) * (4 - 1)')).eval() == 9
예제 #5
0
 def test_div(self):
     assert parser.parse(lexer.lex('2 / 2')).eval() == 1
예제 #6
0
 def test_mul(self):
     assert parser.parse(lexer.lex('2 * 2')).eval() == 4