Commit 17d69216 authored by Taddeus Kroes's avatar Taddeus Kroes

Added test for maximum code coverage in powers rules.

parent 05c35766
......@@ -27,7 +27,7 @@ def match_add_exponents(node):
# Order powers by their roots, e.g. a^p and a^q are put in the same
# list because of the mutual 'a'
s, exponent = n
else:
else: # pragma: nocover
continue
s_str = str(s)
......
......@@ -39,6 +39,14 @@ class TestRulesPowers(RulesTestCase):
[P(root, add_exponents, (Scope(root), a0, a1, a, p, q)),
P(root, add_exponents, (Scope(root), b0, b1, b, p, q))])
def test_match_add_exponents_nary_multiplication(self):
a, p, q = tree('a,p,q')
(n0, l1), n1 = root = a ** p * 2 * a ** q
possibilities = match_add_exponents(root)
self.assertEqualPos(possibilities,
[P(root, add_exponents, (Scope(root), n0, n1, a, p, q))])
def test_match_subtract_exponents_powers(self):
a, p, q = tree('a,p,q')
root = a ** p / a ** q
......
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