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

Fixed negation in rule message.

parent 57dba53e
No related branches found
No related tags found
No related merge requests found
......@@ -116,7 +116,7 @@ def match_negated_division(node):
if a.negated and b.negated:
return [P(node, double_negated_division, ())]
elif b.negated:
return [P(node, single_negated_division, (a, b))]
return [P(node, single_negated_division, (a, +b))]
return []
......@@ -129,7 +129,7 @@ def single_negated_division(root, args):
# FIXME: "-a/b" results in "-(a/b)", which will cause a loop.
return -a / +b
return -a / b
MESSAGES[single_negated_division] = \
......
......@@ -61,7 +61,7 @@ class TestRulesNegation(RulesTestCase):
l1, l2 = root = tree('1 / -2')
possibilities = match_negated_division(root)
self.assertEqualPos(possibilities,
[P(root, single_negated_division, (l1, l2))])
[P(root, single_negated_division, (l1, +l2))])
def test_match_negated_division_double(self):
root = tree('-1 / -2')
......@@ -72,7 +72,7 @@ class TestRulesNegation(RulesTestCase):
def test_single_negated_division(self):
l1, l2 = root = tree('1 / -2')
self.assertEqualNodes(single_negated_division(root, (l1, l2)),
self.assertEqualNodes(single_negated_division(root, (l1, +l2)),
-l1 / +l2)
def test_double_negated_division(self):
......
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