diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-07-08 19:12:07 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-07-08 19:12:07 +0200 |
| commit | 5a500fb8a7c0ba4b8a59e2622c8cbafdc4ce1fe9 (patch) | |
| tree | 5c22b012cf2c37a96735d6ec84ad19e852259e51 /tests/typ/code | |
| parent | c5635d8a3f45865619d66bc9e296da7d9e9efa5a (diff) | |
Range operator
Diffstat (limited to 'tests/typ/code')
| -rw-r--r-- | tests/typ/code/ops-invalid.typ | 3 | ||||
| -rw-r--r-- | tests/typ/code/ops.typ | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/typ/code/ops-invalid.typ b/tests/typ/code/ops-invalid.typ index ab53dd97..4090554c 100644 --- a/tests/typ/code/ops-invalid.typ +++ b/tests/typ/code/ops-invalid.typ @@ -44,6 +44,9 @@ // Error: 3-4 expected function, found integer { 1 with () } +// Error: 3-10 cannot apply '..' to integer and string +{ 1 .. "" } + --- // Bad left-hand sides of assignment. diff --git a/tests/typ/code/ops.typ b/tests/typ/code/ops.typ index a7d5474e..6d788df1 100644 --- a/tests/typ/code/ops.typ +++ b/tests/typ/code/ops.typ @@ -147,6 +147,18 @@ { x += "thing" } #test(x, "something") --- +// Test range operator. + +#let array = (1, 2, 3) +#test(1..3, array) +#test(1.. 3, array) +#test(1 ..3, array) +#test(1 .. 3, array) + +#test(-4..2, (-4, -3, -2, -1, 0, 1, 2)) +#test(10..5, ()) + +--- // Test with operator. // Ref: true |
