aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorWalther Chen <walther.chen@gmail.com>2023-12-05 16:09:09 -0500
committerWalther Chen <walther.chen@gmail.com>2023-12-18 11:55:45 -0500
commit031b0cc53493249be6cb421c65d089e1ce0a06f2 (patch)
tree570d07b6c91e4a64a083ea330c3264ea536d7df6 /tests
parent31b1aef44e1b0178f10f5faa62ceedddda56667b (diff)
fix strings.last_index_any for single char
Diffstat (limited to 'tests')
-rw-r--r--tests/core/strings/test_core_strings.odin12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/core/strings/test_core_strings.odin b/tests/core/strings/test_core_strings.odin
index fdaf3af28..3424675b3 100644
--- a/tests/core/strings/test_core_strings.odin
+++ b/tests/core/strings/test_core_strings.odin
@@ -67,6 +67,18 @@ test_index_any_larger_string_found :: proc(t: ^testing.T) {
expect(t, index == 8, "index_any should be 8")
}
+@test
+test_last_index_any_small_string_found :: proc(t: ^testing.T) {
+ index := strings.last_index_any(".", "/:.\"")
+ expect(t, index == 0, "last_index_any should be 0")
+}
+
+@test
+test_last_index_any_small_string_not_found :: proc(t: ^testing.T) {
+ index := strings.last_index_any(".", "/:\"")
+ expect(t, index == -1, "last_index_any should be -1")
+}
+
Cut_Test :: struct {
input: string,
offset: int,