summaryrefslogtreecommitdiff
path: root/tests/typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-02-13 17:44:14 +0100
committerLaurenz <laurmaedje@gmail.com>2023-02-13 17:45:08 +0100
commit17e9805b34562781d514ba6b0df31155c8d39824 (patch)
treec5c4761f59d6ffa57755660f51e88621ddcff689 /tests/typ
parent5233b1c50a4a671fdc38cf0d40868f8c075d9ed7 (diff)
Let `eval` take code instead of markup
Diffstat (limited to 'tests/typ')
-rw-r--r--tests/typ/compute/foundations.typ30
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/typ/compute/foundations.typ b/tests/typ/compute/foundations.typ
index 602bc22d..83cda65f 100644
--- a/tests/typ/compute/foundations.typ
+++ b/tests/typ/compute/foundations.typ
@@ -27,14 +27,14 @@
#test(type(10 / 3), "float")
---
-#eval("_Hello" + " World!_")
+#eval("[_Hello" + " World!_]")
---
-// Error: 7-13 expected identifier
-#eval("#let")
+// Error: 7-12 expected identifier
+#eval("let")
---
-#show raw: it => text("IBM Plex Sans", eval(it.text))
+#show raw: it => text("IBM Plex Sans", eval("[" + it.text + "]"))
Interacting
```
@@ -43,28 +43,28 @@ Blue #move(dy: -0.15em)[🌊]
```
---
-// Error: 7-18 cannot continue outside of loop
-#eval("#continue")
+// Error: 7-17 cannot continue outside of loop
+#eval("continue")
---
-// Error: 7-33 cannot access file system from here
-#eval("#include \"../coma.typ\"")
+// Error: 7-32 cannot access file system from here
+#eval("include \"../coma.typ\"")
---
-// Error: 7-31 cannot access file system from here
-#eval("#image(\"/tiger.jpg\")")
+// 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")
+image("/tiger.jpg")
```
---
-// Error: 23-30 cannot access file system from here
-#show raw: it => eval(it.text)
+// Error: 23-42 cannot access file system from here
+#show raw: it => eval("[" + it.text + "]")
```
#show emph: _ => image("/giraffe.jpg")
@@ -72,5 +72,5 @@ _No relative giraffe!_
```
---
-// Error: 7-15 expected comma
-#eval("#(1 2)")
+// Error: 7-12 expected semicolon or line break
+#eval("1 2")