Finish unify_render! :D and even mod the doc
This commit is contained in:
@@ -8,7 +8,7 @@ import unittest
|
||||
from pymath.expression import Expression
|
||||
from pymath.fraction import Fraction
|
||||
from pymath.generic import first_elem
|
||||
from pymath.renders import txt
|
||||
from pymath.renders import txt, tex
|
||||
|
||||
|
||||
class TestExpression(unittest.TestCase):
|
||||
@@ -76,6 +76,7 @@ class TestExpression(unittest.TestCase):
|
||||
|
||||
def test_simplify_frac(self):
|
||||
exp = Expression("1/2 - 4")
|
||||
Expression.STR_RENDER = lambda _,x : str(x)
|
||||
steps = ["[1, 2, '/', 4, '-']", \
|
||||
"[< Fraction 1 / 2>, 4, '-']", \
|
||||
"[1, 1, '*', 2, 1, '*', '/', 4, 2, '*', 1, 2, '*', '/', '-']", \
|
||||
@@ -83,6 +84,8 @@ class TestExpression(unittest.TestCase):
|
||||
'[< Fraction -7 / 2>]']
|
||||
self.assertEqual(steps, list(exp.simplify()))
|
||||
|
||||
Expression.STR_RENDER = tex
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
Reference in New Issue
Block a user