Feat: add test on what doesn't work!

This commit is contained in:
Bertrand Benjamin 2020-12-15 14:36:39 +01:00
parent 48088762be
commit a1608a20d1

View File

@ -108,13 +108,12 @@ x^7
(6 + 6) * x + 4x^2 + 9
4x^2 + 12x + 9
>>> e = Expression.from_str("(2x+3)(-x+1)")
>>> e = Expression.from_str("(2x-3)(-x+2)")
>>> e_simplified = e.simplify()
>>> e_simplified
<Quadratic - 2x^2 - x + 3>
<Quadratic - 2x^2 + 7x - 6>
>>> for s in e_simplified.explain():
... print(s)
"""
from .expression import Expression
@ -155,19 +154,12 @@ def set_render(render):
if __name__ == "__main__":
e = Expression.from_str("1+2/3/4/5")
et = e._typing()
print("typing")
print(e._tree)
e = et._order()
print("order")
print(e._tree)
e = e._optimize()
print("then optimize")
print(e._tree)
e = et._optimize()
print("optimize without order")
print(e._tree)
e = Expression.from_str("(2x-3)(-x+2)")
e_simplified = e.simplify()
e_simplified
for s in e_simplified.explain():
print(s._tree.map_on_leaf(lambda x: type(x)))
print(s)
# -----------------------------
# Reglages pour 'vim'