From 49e0ce47d4fdd3f41dde1e376977d545fc8c542e Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Sun, 7 Aug 2022 15:54:30 -0700 Subject: Define last-index. --- lib/csc/strings-test.csc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lib/csc/strings-test.csc') diff --git a/lib/csc/strings-test.csc b/lib/csc/strings-test.csc index 1f981ad..95dbb59 100644 --- a/lib/csc/strings-test.csc +++ b/lib/csc/strings-test.csc @@ -42,6 +42,24 @@ (index "def" "a"))) + (test last-index-last + (assert-equal + 4 + (last-index "ababa" "a"))) + + + (test last-index-penultimate + (assert-equal + 4 + (last-index "ababab" "a"))) + + + (test last-index-notfound + (assert-equal + -1 + (last-index "abcdfads" ";"))) + + (test contains (assert-equal #t -- cgit v1.3.1