summaryrefslogtreecommitdiff
path: root/tests/typ/expr/call.typ
diff options
context:
space:
mode:
Diffstat (limited to 'tests/typ/expr/call.typ')
-rw-r--r--tests/typ/expr/call.typ40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/typ/expr/call.typ b/tests/typ/expr/call.typ
new file mode 100644
index 00000000..213d5554
--- /dev/null
+++ b/tests/typ/expr/call.typ
@@ -0,0 +1,40 @@
+// Test function calls.
+
+---
+// One argument.
+#args(bold)
+
+// One argument and trailing comma.
+#args(1,)
+
+// One named argument.
+#args(a:2)
+
+// Mixed arguments.
+{args(1, b: "2", 3)}
+
+---
+// Different forms of template arguments.
+// Ref: true
+
+#let a = "a"
+
+#args[a] \
+#args(a) \
+#args(a, [b]) \
+#args(a)[b] \
+
+// Template can be argument or body depending on whitespace.
+#if "template" == type[b] [Sure ]
+#if "template" == type [Nope.] #else [thing.]
+
+// Should output `<function args> (Okay.)`.
+#args (Okay.)
+
+---
+// Call function assigned to variable.
+#let alias = type
+#test(alias(alias), "function")
+
+// Library function `font` returns template.
+#test(type(font(12pt)), "template")