texmf-dist/tex/lualatex/luacas/test/expressions/luacas-functions.lua
raw| 1 | local a = FunctionExpression("f", |
| 2 | {SymbolExpression("x"), |
| 3 | BinaryOperation.MULEXP |
| 4 | ({SymbolExpression("x"), |
| 5 | Integer(2)})}) |
| 6 | |
| 7 | local b = BinaryOperation.ADDEXP |
| 8 | ({FunctionExpression("g", |
| 9 | {SymbolExpression("x")}), |
| 10 | FunctionExpression("f", |
| 11 | {SymbolExpression("x")}), |
| 12 | Integer(4)}) |
| 13 | |
| 14 | starttest("function expressions") |
| 15 | testeq(a:autosimplify(), parse("f(x, (2 * x))"), a) |
| 16 | testeq(b:autosimplify(), parse("(4 + f(x) + g(x))"), b) |
| 17 | endtest() |