diff options
| author | Sébastien d'Herbais de Thun <sebastien.d.herbais@gmail.com> | 2023-10-10 11:44:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-10 11:44:59 +0200 |
| commit | a8af6b449ac8ad607595649efde08e2d2b46d668 (patch) | |
| tree | cc7baa4157670f805882e5ece2dd4283363253c4 /tests/typ/compiler/array.typ | |
| parent | cef2d3afcae87230dbe361ef48ecb5dad50ad0a5 (diff) | |
Adds a default value to `.remove()` on `dict` and `array` (#2346)
Diffstat (limited to 'tests/typ/compiler/array.typ')
| -rw-r--r-- | tests/typ/compiler/array.typ | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/typ/compiler/array.typ b/tests/typ/compiler/array.typ index 92d926a0..12c3c3a0 100644 --- a/tests/typ/compiler/array.typ +++ b/tests/typ/compiler/array.typ @@ -64,6 +64,19 @@ #test((1, 2, 3).at(3, default: 5), 5) --- +// Test remove with default value. + +#{ + let array = (1, 2, 3) + test(array.remove(2, default: 5), 3) +} + +#{ + let array = (1, 2, 3) + test(array.remove(3, default: 5), 5) +} + +--- // Test bad lvalue. // Error: 2:3-2:14 cannot mutate a temporary value #let array = (1, 2, 3) |
