diff options
Diffstat (limited to 'macros/luatex/latex/luacas/tex/test/expressions/substitute.lua')
-rw-r--r-- | macros/luatex/latex/luacas/tex/test/expressions/substitute.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/macros/luatex/latex/luacas/tex/test/expressions/substitute.lua b/macros/luatex/latex/luacas/tex/test/expressions/substitute.lua new file mode 100644 index 0000000000..4d1f3496bf --- /dev/null +++ b/macros/luatex/latex/luacas/tex/test/expressions/substitute.lua @@ -0,0 +1,10 @@ +local a = parse("3*(x+1)^1/2-6*y+3*z^2") +local b = parse("sin(e^x - 1) + e^x") + +starttest("substitution") +testeq(a:substitute({[parse("x")] = Integer(3), + [parse("y")] = Integer(-1), + [parse("z")] = Integer(4)/Integer(3)}):autosimplify(), parse("52/3")) + +testeq(b:substitute({[parse("e^x")] = parse("x^e")}), parse("((x ^ e) + sin((-1 + (x ^ e))))")) +endtest()
\ No newline at end of file |