summaryrefslogtreecommitdiff
path: root/tests/typ/code
diff options
context:
space:
mode:
Diffstat (limited to 'tests/typ/code')
-rw-r--r--tests/typ/code/ops.typ18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/typ/code/ops.typ b/tests/typ/code/ops.typ
index e2ecd4ff..a7d5474e 100644
--- a/tests/typ/code/ops.typ
+++ b/tests/typ/code/ops.typ
@@ -145,3 +145,21 @@
{ x /= 2.0 } #test(x, 18.0)
{ x = "some" } #test(x, "some")
{ x += "thing" } #test(x, "something")
+
+---
+// Test with operator.
+// Ref: true
+
+// Apply positional arguments.
+#let add(x, y) = x + y
+#test((add with (2))(4), 6)
+
+// Let .. with .. syntax.
+#let f = add
+#let f with (2)
+#test(f(4), 6)
+
+// Make sure that named arguments are overridable.
+#let align with (horizontal: right)
+#align[Right] \
+#align(horizontal: left)[Left]