summaryrefslogtreecommitdiff
path: root/tests/typ/compute
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-11-25 16:10:28 +0100
committerLaurenz <laurmaedje@gmail.com>2023-11-26 19:03:21 +0100
commit85b1d1d4dd4628d1fb8901c3280cde84da450bbe (patch)
treeb69a629be9295268e071667b1587a5701f2bc7ef /tests/typ/compute
parent2f795b5c07171affa0709195a9dae3ed5c0afbeb (diff)
Rework `Vt` into `Engine`
- Moves as much data out of the `Vm` - Removes duplication with call_vm and call_vt flavours - Uses tracked chain instead of fixed int for determining max nesting depth - This means that nesting checks now generalizes to layout and realization, to detect crashing show rules and overly nested layouts
Diffstat (limited to 'tests/typ/compute')
-rw-r--r--tests/typ/compute/eval-path.typ18
-rw-r--r--tests/typ/compute/foundations.typ25
2 files changed, 18 insertions, 25 deletions
diff --git a/tests/typ/compute/eval-path.typ b/tests/typ/compute/eval-path.typ
new file mode 100644
index 00000000..c02bdfb1
--- /dev/null
+++ b/tests/typ/compute/eval-path.typ
@@ -0,0 +1,18 @@
+// Test file loading in eval.
+
+---
+// Test absolute path.
+#eval("image(\"/files/tiger.jpg\", width: 50%)")
+
+---
+#show raw: it => eval(it.text, mode: "markup")
+
+```
+#show emph: image("/files/tiger.jpg", width: 50%)
+_Tiger!_
+```
+
+---
+// Test relative path.
+// Ref: false
+#test(eval(`"HELLO" in read("./eval-path.typ")`.text), true)
diff --git a/tests/typ/compute/foundations.typ b/tests/typ/compute/foundations.typ
index 4e74966f..cabed0bf 100644
--- a/tests/typ/compute/foundations.typ
+++ b/tests/typ/compute/foundations.typ
@@ -103,30 +103,5 @@ Blue #move(dy: -0.15em)[🌊]
#eval("continue")
---
-// Error: 7-32 cannot access file system from here
-#eval("include \"../coma.typ\"")
-
----
-// Error: 7-30 cannot access file system from here
-#eval("image(\"/tiger.jpg\")")
-
----
-// Error: 23-30 cannot access file system from here
-#show raw: it => eval(it.text)
-
-```
-image("/tiger.jpg")
-```
-
----
-// Error: 23-42 cannot access file system from here
-#show raw: it => eval("[" + it.text + "]")
-
-```
-#show emph: _ => image("/giraffe.jpg")
-_No relative giraffe!_
-```
-
----
// Error: 7-12 expected semicolon or line break
#eval("1 2")