diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref/code/for.png | bin | 3123 -> 4003 bytes | |||
| -rw-r--r-- | tests/typ/code/for.typ | 6 |
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/ref/code/for.png b/tests/ref/code/for.png Binary files differindex 1ef08f7a..f9d42124 100644 --- a/tests/ref/code/for.png +++ b/tests/ref/code/for.png 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 = () |
