Bladeren bron

Removed explicit negation node from test cases.

Sander Mathijs van Veen 14 jaren geleden
bovenliggende
commit
1c9969fde6
2 gewijzigde bestanden met toevoegingen van 3 en 8 verwijderingen
  1. 1 6
      tests/test_b1_ch10.py
  2. 2 2
      tests/test_calc.py

+ 1 - 6
tests/test_b1_ch10.py

@@ -28,12 +28,7 @@ class TestB1Ch10(unittest.TestCase):
                 )
             ),
             ('-x3*-2x5',
-                N('*',
-                  N('*',
-                    N('-', N('^', L('x'), L(3))),
-                    N('-', L(2))),
-                  N('^', L('x'), L(5))
-                )
+                -(L('x') ** L(3)) * - L(2) * L('x') ** L(5)
             ),
             ('(7x2y3)^2/(7x2y3)',
                 N('/',

+ 2 - 2
tests/test_calc.py

@@ -24,7 +24,7 @@ class TestCalc(unittest.TestCase):
 
     def test_infinity(self):
         expressions = [('2^3000',  N('^', L(2), L(3000))),
-                       ('2^-3000', N('^', L(2), N('-', L(3000))))]
+                       ('2^-3000', N('^', L(2), -L(3000)))]
         #               ('2^99999999999', None),
         #               ('2^-99999999999', 0.0)]
 
@@ -70,7 +70,7 @@ class TestCalc(unittest.TestCase):
 
         expressions = [
                        ('a^b^c', N('^', a, N('^', b, c))),
-                       ('-1^b^c', N('-', N('^', L(1), N('^', b, c)))),
+                       ('-1^b^c', -N('^', L(1), N('^', b, c))),
                        ('ab^c', N('*', a, N('^', b, c))),
                        ('a(b)^c', N('*', a, N('^', b, c))),
                        ('a(b+c)^(d+e)', N('*', a, N('^', N('+', b, c),