aboutsummaryrefslogtreecommitdiffstats
path: root/lib/csc/strings-test.csc
diff options
context:
space:
mode:
authorRose Hogenson <rhogenson@posteo.net>2022-08-07 15:54:30 -0700
committerRose Hogenson <rhogenson@posteo.net>2022-08-07 15:54:30 -0700
commit49e0ce47d4fdd3f41dde1e376977d545fc8c542e (patch)
tree372a9c0fe4eb2049670c19da98d7643229f3bce3 /lib/csc/strings-test.csc
parent3f41d1ada092029d99aae980823eb6014a22a191 (diff)
downloadchromatopelma-49e0ce47d4fdd3f41dde1e376977d545fc8c542e.tar.zst
Define last-index.
Diffstat (limited to 'lib/csc/strings-test.csc')
-rw-r--r--lib/csc/strings-test.csc18
1 files changed, 18 insertions, 0 deletions
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