Commit 8d921d80 authored by Taddeus Kroes's avatar Taddeus Kroes

Added a validation test.

parent 5211c176
...@@ -235,7 +235,6 @@ def match_divide_fractions(node): ...@@ -235,7 +235,6 @@ def match_divide_fractions(node):
a / b / c -> a / (bc) a / b / c -> a / (bc)
a / (b / c) -> ac / b a / (b / c) -> ac / b
""" """
# TODO: IMPLICIT: a / b / (c / d) ->* ad / bd -> validation test!
assert node.is_op(OP_DIV) assert node.is_op(OP_DIV)
nom, denom = node nom, denom = node
......
...@@ -12,6 +12,7 @@ class TestValidation(TestCase): ...@@ -12,6 +12,7 @@ class TestValidation(TestCase):
def test_intermediate_success(self): def test_intermediate_success(self):
self.assertTrue(validate('3a+a+b+2b', '4a+3b')) self.assertTrue(validate('3a+a+b+2b', '4a+3b'))
self.assertTrue(validate('a/b/(c/d)', 'ad/(bc)'))
def test_intermediate_failure(self): def test_intermediate_failure(self):
self.assertFalse(validate('3a+a+b+2b', '4a+4b')) self.assertFalse(validate('3a+a+b+2b', '4a+4b'))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment