From 82b2bdc8e2d478328d2e4560b485db7050093a91 Mon Sep 17 00:00:00 2001 From: sogaiu <33044872+sogaiu@users.noreply.github.com> Date: Mon, 17 Aug 2026 01:49:01 +0000 Subject: [PATCH] Add tests for find-index (#1807) Co-authored-by: sogaiu <983021772@users.noreply.github.com> --- test/suite-boot.janet | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/suite-boot.janet b/test/suite-boot.janet index d905b724..7f37f2d5 100644 --- a/test/suite-boot.janet +++ b/test/suite-boot.janet @@ -1058,4 +1058,10 @@ (assert (deep= (distinct @{0 :a 1 :b 2 :b 3 :a}) @[:a :b])) (assert (deep= (distinct (coro (yield 8) (yield 11) (yield 8))) @[8 11])) +# find-index +(assert (= (find-index |(= (chr "c") $) "abc") 2)) +(assert (= (find-index |(= $ :goose) [:duck :duck :goose]) 2)) +(assert (= (find-index pos? @[-2 -1 0 -3] :surprise!) :surprise!)) +(assert (= (find-index zero? {:a 2 :b 1 :c 0}) :c)) + (end-suite)