summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
author+merlan #flirora <flirora@flirora.xyz>2025-03-31 05:06:18 -0400
committerGitHub <noreply@github.com>2025-03-31 09:06:18 +0000
commita64af130dc84c84442d59f322b705bded28201de (patch)
tree5a27cc17b861cca3d0f06b9edf3de432701ada2a /tests
parent1082181a6f789b73fbc64c4ff5bc1401ad081e76 (diff)
Add default parameter for array.{first, last} (#5970)
Diffstat (limited to 'tests')
-rw-r--r--tests/suite/foundations/array.typ4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/suite/foundations/array.typ b/tests/suite/foundations/array.typ
index 6228f471..61b5decb 100644
--- a/tests/suite/foundations/array.typ
+++ b/tests/suite/foundations/array.typ
@@ -179,6 +179,10 @@
#test((2,).last(), 2)
#test((1, 2, 3).first(), 1)
#test((1, 2, 3).last(), 3)
+#test((1, 2).first(default: 99), 1)
+#test(().first(default: 99), 99)
+#test((1, 2).last(default: 99), 2)
+#test(().last(default: 99), 99)
--- array-first-empty ---
// Error: 2-12 array is empty