From 40302e472a2ee322d5d39ebb92c6782717ffc858 Mon Sep 17 00:00:00 2001 From: Malo <57839069+MDLC01@users.noreply.github.com> Date: Thu, 23 Jan 2025 14:26:01 +0100 Subject: [PATCH] Add test for invalid `compare` value --- tests/suite/foundations/array.typ | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/suite/foundations/array.typ b/tests/suite/foundations/array.typ index 2fbd185d6..d775646f0 100644 --- a/tests/suite/foundations/array.typ +++ b/tests/suite/foundations/array.typ @@ -358,6 +358,10 @@ #test(("I", "the", "hi", "text").sorted(compare: (x, y) => x.len() - y.len()), ("I", "hi", "the", "text")) #test(("I", "the", "hi", "text").sorted(key: x => x.len(), compare: (x, y) => y - x), ("text", "the", "hi", "I")) +--- array-sorted-invalid-compare-function --- +// Error: 2-44 expected integer from `compare` function, got string +#(1, 2, 3).sorted(compare: (_, _) => "hmm") + --- array-sorted-key-function-positional-1 --- // Error: 12-18 unexpected argument #().sorted(x => x)