summaryrefslogtreecommitdiff
path: root/tests/typ
diff options
context:
space:
mode:
Diffstat (limited to 'tests/typ')
-rw-r--r--tests/typ/code/call-wide.typ47
1 files changed, 47 insertions, 0 deletions
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!