Jelajahi Sumber

Fixed unit tests for powers rules.

Taddeus Kroes 14 tahun lalu
induk
melakukan
144bf670a6
2 mengubah file dengan 4 tambahan dan 4 penghapusan
  1. 1 1
      src/rules/powers.py
  2. 3 3
      tests/test_rules_powers.py

+ 1 - 1
src/rules/powers.py

@@ -162,7 +162,7 @@ MESSAGES[duplicate_exponent] = _('Duplicate the exponent {2}.')
 
 def match_remove_negative_exponent(node):
     """
-    a^-p  ->  1 / a^p
+    a ^ -p  ->  1 / a ^ p
     """
     assert node.is_op(OP_POW)
 

+ 3 - 3
tests/test_rules_powers.py

@@ -132,11 +132,11 @@ class TestRulesPowers(RulesTestCase):
                               a ** p * b ** p * c ** p)
 
     def test_remove_negative_exponent(self):
-        a, p, l1 = tree('a,p,1')
-        root = a ** -p
+        a, p, l1 = tree('a,-p,1')
+        root = a ** p
 
         self.assertEqualNodes(remove_negative_exponent(root, (a, p)),
-                              l1 / a ** p)
+                              l1 / a ** +p)
 
     def test_exponent_to_root(self):
         a, n, m, l1 = tree('a,n,m,1')