diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref/compute/foundations.png | bin | 0 -> 2344 bytes | |||
| -rw-r--r-- | tests/typ/compute/foundations.typ | 12 |
2 files changed, 11 insertions, 1 deletions
diff --git a/tests/ref/compute/foundations.png b/tests/ref/compute/foundations.png Binary files differnew file mode 100644 index 00000000..5d6ba744 --- /dev/null +++ b/tests/ref/compute/foundations.png diff --git a/tests/typ/compute/foundations.typ b/tests/typ/compute/foundations.typ index 9c7b13ca..3da2e601 100644 --- a/tests/typ/compute/foundations.typ +++ b/tests/typ/compute/foundations.typ @@ -73,7 +73,17 @@ #test(type(10 / 3), "float") --- -#eval("[_Hello" + " World!_]") +// Test the eval function. +#test(eval("1 + 2"), 3) +#test(eval("1 + x", scope: (x: 3)), 4) +#test(eval("let x = x + 1; x + 1", scope: (x: 1)), 3) + +--- +// Test evaluation in other modes. +// Ref: true +#eval("[_Hello" + " World!_]") \ +#eval("_Hello" + " World!_", mode: "markup") \ +#eval("RR_1^NN", mode: "math", scope: (RR: math.NN, NN: math.RR)) --- // Error: 7-12 expected identifier |
