summaryrefslogtreecommitdiff
path: root/tests/suite/scripting/destructuring.typ
diff options
context:
space:
mode:
authorOrange <89233794+Ang149@users.noreply.github.com>2024-10-07 17:59:49 +0800
committerGitHub <noreply@github.com>2024-10-07 09:59:49 +0000
commitbb39d8f10a3820a1fbda6c50d8df5745ccc11de2 (patch)
tree43ca061ce3080edcb35197b67dfee10045bacb15 /tests/suite/scripting/destructuring.typ
parent2a40eb518c737f4644099881a23295a650eb9ea1 (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/suite/scripting/destructuring.typ')
-rw-r--r--tests/suite/scripting/destructuring.typ16
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 ---