summaryrefslogtreecommitdiff
path: root/tests/typ/code/for.typ
diff options
context:
space:
mode:
Diffstat (limited to 'tests/typ/code/for.typ')
-rw-r--r--tests/typ/code/for.typ6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/typ/code/for.typ b/tests/typ/code/for.typ
index 2569f5a7..02bd0a27 100644
--- a/tests/typ/code/for.typ
+++ b/tests/typ/code/for.typ
@@ -32,6 +32,12 @@
// Should output `2345`.
#for v in (1, 2, 3, 4, 5, 6, 7) [#if v >= 2 and v <= 5 { repr(v) }]
+// Loop over captured arguments.
+#let f1(..args) = for v in args { (repr(v),) }
+#let f2(..args) = for k, v in args { (repr(k) + ": " + repr(v),) }
+#let f(..args) = join(sep: ", ", ..f1(..args), ..f2(..args))
+#f(1, a: 2)
+
---
#let out = ()