texmf-dist/tex/lualatex/luacas/test/expressions/luacas-substitute.lua
raw| 1 | local a = parse("3*(x+1)^1/2-6*y+3*z^2") |
| 2 | local b = parse("sin(e^x - 1) + e^x") |
| 3 | |
| 4 | starttest("substitution") |
| 5 | testeq(a:substitute({[parse("x")] = Integer(3), |
| 6 | [parse("y")] = Integer(-1), |
| 7 | [parse("z")] = Integer(4)/Integer(3)}):autosimplify(), parse("52/3")) |
| 8 | |
| 9 | testeq(b:substitute({[parse("e^x")] = parse("x^e")}), parse("((x ^ e) + sin((-1 + (x ^ e))))")) |
| 10 | endtest() |