summaryrefslogtreecommitdiff
path: root/macros/luatex/latex/luacas/tex/test/expressions/substitute.lua
blob: 4d1f3496bffb1ac8af5f5f1a50f81af9d27770df (plain)
1
2
3
4
5
6
7
8
9
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()