summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-06-29 13:08:16 +0200
committerLaurenz <laurmaedje@gmail.com>2021-06-29 13:49:50 +0200
commitb89cd128ae118571efe8a5a5b40b9365e3007746 (patch)
tree5f13a9bab6f83d0a7b055afbaa69c736e53679a7 /tests
parent6d0911d7a858ff6a770ca1556e91791fb1838ec1 (diff)
Wide calls
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/code/call-wide.pngbin0 -> 1864 bytes
-rw-r--r--tests/typ/code/call-wide.typ47
2 files changed, 47 insertions, 0 deletions
diff --git a/tests/ref/code/call-wide.png b/tests/ref/code/call-wide.png
new file mode 100644
index 00000000..028d7aa4
--- /dev/null
+++ b/tests/ref/code/call-wide.png
Binary files differ
diff --git a/tests/typ/code/call-wide.typ b/tests/typ/code/call-wide.typ
new file mode 100644
index 00000000..2bb6d82e
--- /dev/null
+++ b/tests/typ/code/call-wide.typ
@@ -0,0 +1,47 @@
+// Test wide calls.
+
+---
+// Test multiple wide calls in separate expressions.
+#font!(color: eastern) - First
+#font!(color: forest) - Second
+
+---
+// Test in heading.
+# A #align!(right) B
+C
+
+---
+// Test evaluation semantics.
+// Ref: false
+
+#let r
+#let x = 1
+#let f(x, body) = (x, body)
+
+[
+ { r = f!(x) }
+ { x = 2 }
+]
+
+#test(repr(r), "(1, <template>)")
+
+---
+// Test multiple wide calls in one expression.
+// Ref: false
+
+#let id(x) = x
+#let add(x, y) = x + y
+
+// Error: 11-13 duplicate wide call
+[{id!() + id!()}]
+
+// Test nested wide calls.
+// Error: 2-6 duplicate wide call
+[#add!(id!())]
+
+---
+// Test missing parentheses.
+// Ref: false
+
+// Error: 4 expected argument list
+#f!