diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-06-26 18:07:05 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-06-26 18:07:05 +0200 |
| commit | 422b8e640f00977177a5a7250a3c56009eed10c4 (patch) | |
| tree | b1a21718e9511d776a6de47b713e3308bb1baaad /tests | |
| parent | d53c933e4d56e6c0484d81814779ddb1597ee032 (diff) | |
With expressions
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref/code/ops.png | bin | 782 -> 1404 bytes | |||
| -rw-r--r-- | tests/typ/code/ops.typ | 18 |
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/ref/code/ops.png b/tests/ref/code/ops.png Binary files differindex b566b5b7..4421edb4 100644 --- a/tests/ref/code/ops.png +++ b/tests/ref/code/ops.png 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] |
