Skip to content
Snippets Groups Projects
Commit 821bdb8f authored by Taddeus Kroes's avatar Taddeus Kroes
Browse files

Added test for unary operator parentheses.

parent 5a1d45ef
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,10 @@ class TestLine(unittest.TestCase):
exp = N('*', N('/', N('*', a, b), c), d)
self.assertEquals(generate_line(exp), 'ab / c * d')
def test_parentheses_unary(self):
neg = N('-', N('+', L(1), L(2)))
self.assertEquals(generate_line(neg), '-(1 + 2)')
def test_parentheses_nary(self):
l0, l1, l2 = L(1), L(2), L(3)
plus = N('+', N('+', l0, l1), l2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment