tests/test_string.c

changeset 1412
a6f357c18ac6
parent 1410
be4071f5e9aa
--- a/tests/test_string.c	Wed Oct 01 22:45:48 2025 +0200
+++ b/tests/test_string.c	Thu Oct 02 17:58:43 2025 +0200
@@ -200,7 +200,7 @@
 }
 
 CX_TEST(test_strrchr) {
-    cxstring str = CX_STR("I will find you - and I will kill you");
+    cxstring str = CX_STR("X will find you - and I will kill you");
 
     CX_TEST_DO {
         cxstring notfound = cx_strrchr(str, 'x');
@@ -210,6 +210,13 @@
         CX_TEST_ASSERT(result.length == 13);
         CX_TEST_ASSERT(0 == strcmp(result.ptr, "will kill you"));
 
+        result = cx_strrchr(str, 'u');
+        CX_TEST_ASSERT(result.length == 1);
+        CX_TEST_ASSERT(0 == strcmp(result.ptr, "u"));
+
+        result = cx_strrchr(str, 'X');
+        CX_TEST_ASSERT(0 == cx_strcmp(result, str));
+
         // just for coverage, call the _m variant
         cxmutstr m = cx_strrchr_m(cx_mutstrn(NULL, 0), 'a');
         CX_TEST_ASSERT(0 == cx_strcmp(cx_strcast(m), cx_str("")));

mercurial