summaryrefslogtreecommitdiff
path: root/macros/luatex/latex/luacas/tex/test/expressions/luacas-functions.lua
blob: e2c15096d6926679fc810b3afd54af3556fdc454 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
local a = FunctionExpression("f",
            {SymbolExpression("x"),
            BinaryOperation.MULEXP
                ({SymbolExpression("x"),
                Integer(2)})})

local b = BinaryOperation.ADDEXP
            ({FunctionExpression("g",
                {SymbolExpression("x")}),
            FunctionExpression("f",
                {SymbolExpression("x")}),
                Integer(4)})

starttest("function expressions")
testeq(a:autosimplify(), parse("f(x, (2 * x))"), a)
testeq(b:autosimplify(), parse("(4 + f(x) + g(x))"), b)
endtest()