test coverage for cx_strcmp pointer variants

Sat, 01 Apr 2023 11:00:59 +0200

author
Mike Becker <universe@uap-core.de>
date
Sat, 01 Apr 2023 11:00:59 +0200
changeset 671
d7a67375a7ac
parent 670
4ad8ea3aee49
child 672
55d8fdd38ca4

test coverage for cx_strcmp pointer variants

tests/test_string.cpp file | annotate | diff | comparison | revisions
--- a/tests/test_string.cpp	Tue Mar 28 21:00:33 2023 +0200
+++ b/tests/test_string.cpp	Sat Apr 01 11:00:59 2023 +0200
@@ -213,6 +213,11 @@
     EXPECT_GT(cx_strcmp(str, cx_str("compare shit")), 0);
     EXPECT_LT(cx_strcmp(str, cx_str("compare this not")), 0);
     EXPECT_GT(cx_strcmp(str, cx_str("compare")), 0);
+
+    cxstring str2 = cx_str("Compare This");
+    EXPECT_NE(cx_strcmp_p(&str, &str2), 0);
+    str2 = cx_str("compare this");
+    EXPECT_EQ(cx_strcmp_p(&str, &str2), 0);
 }
 
 TEST(String, strcasecmp) {
@@ -226,6 +231,11 @@
     EXPECT_GT(cx_strcasecmp(str, cx_str("compare shit")), 0);
     EXPECT_LT(cx_strcasecmp(str, cx_str("compare this not")), 0);
     EXPECT_GT(cx_strcasecmp(str, cx_str("compare")), 0);
+
+    cxstring str2 = cx_str("Compare This");
+    EXPECT_EQ(cx_strcasecmp_p(&str, &str2), 0);
+    str2 = cx_str("Compare Tool");
+    EXPECT_LT(cx_strcasecmp_p(&str, &str2), 0);
 }
 
 TEST(String, strcat) {

mercurial