diff options
| author | Orange <89233794+Ang149@users.noreply.github.com> | 2024-10-07 17:59:49 +0800 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2024-10-15 15:06:36 +0200 |
| commit | 0e5144f9bafc54fd619cd36337907ecfb8c11bf4 (patch) | |
| tree | bade85d8c7ba93ba7bf12d5d1cb95d73bc2dc178 /tests | |
| parent | 695d24baed1204e73b8ec6be6fe7e7fbcc79ecec (diff) | |
Improve hint when provided array for destructuring has fewer elements than expected (#5139)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/suite/scripting/destructuring.typ | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/suite/scripting/destructuring.typ b/tests/suite/scripting/destructuring.typ index 9d28c195..e70f676f 100644 --- a/tests/suite/scripting/destructuring.typ +++ b/tests/suite/scripting/destructuring.typ @@ -128,13 +128,13 @@ #let () = (1, 2) --- destructuring-let-array-too-few-elements --- -// Error: 13-14 not enough elements to destructure -// Hint: 13-14 the provided array has a length of 2 +// Error: 6-15 not enough elements to destructure +// Hint: 6-15 the provided array has a length of 2, but the pattern expects 3 elements #let (a, b, c) = (1, 2) --- destructuring-let-array-too-few-elements-with-sink --- -// Error: 7-10 not enough elements to destructure -// Hint: 7-10 the provided array has a length of 2 +// Error: 6-20 not enough elements to destructure +// Hint: 6-20 the provided array has a length of 2, but the pattern expects at least 3 elements #let (..a, b, c, d) = (1, 2) --- destructuring-let-array-bool-invalid --- @@ -192,8 +192,8 @@ --- destructuring-let-array-trailing-placeholders --- // Trailing placeholders. -// Error: 10-11 not enough elements to destructure -// Hint: 10-11 the provided array has a length of 1 +// Error: 6-21 not enough elements to destructure +// Hint: 6-21 the provided array has a length of 1, but the pattern expects 5 elements #let (a, _, _, _, _) = (1,) #test(a, 1) @@ -360,8 +360,8 @@ #for (x, y) in (1, 2) {} --- issue-3275-destructuring-loop-over-2d-array-1 --- -// Error: 10-11 not enough elements to destructure -// Hint: 10-11 the provided array has a length of 1 +// Error: 6-12 not enough elements to destructure +// Hint: 6-12 the provided array has a length of 1, but the pattern expects 2 elements #for (x, y) in ((1,), (2,)) {} --- issue-3275-destructuring-loop-over-2d-array-2 --- |
