summaryrefslogtreecommitdiff
path: root/tests/typ/code
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-06-30 11:04:53 +0200
committerGitHub <noreply@github.com>2021-06-30 11:04:53 +0200
commit45812b700114a51f0ee21e31f4454cde3729eaf5 (patch)
tree435e5a0ade7dc2cbf9199418c618846bb655e957 /tests/typ/code
parent1c43d8af12a8d318fb681713d0e66eb754485589 (diff)
parentb2fb42cc7019b0269e892c4e39c52557252fecf9 (diff)
Merge pull request #35 from typst/wide-calls
Wide calls
Diffstat (limited to 'tests/typ/code')
-rw-r--r--tests/typ/code/call-wide.typ47
-rw-r--r--tests/typ/code/call.typ3
2 files changed, 47 insertions, 3 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!
diff --git a/tests/typ/code/call.typ b/tests/typ/code/call.typ
index 5351eb29..eb5c6732 100644
--- a/tests/typ/code/call.typ
+++ b/tests/typ/code/call.typ
@@ -23,9 +23,6 @@
#let alias = type
#test(alias(alias), "function")
-// Library function `font` returns template.
-#test(type(font(size: 12pt)), "template")
-
---
// Callee expressions.
{