summaryrefslogtreecommitdiff
path: root/tests/unit/core
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2021-11-09 20:41:23 +0100
committerSébastien Helleu <flashcode@flashtux.org>2021-11-09 20:41:23 +0100
commit5ddd72c0e95cfa7714dbd1f34155b473f89e195e (patch)
tree1403294565b864bb051f1552f2024feb127b1a6b /tests/unit/core
parent80b86ea647cc2b0faa380563410f6939ccbf828a (diff)
downloadweechat-5ddd72c0e95cfa7714dbd1f34155b473f89e195e.zip
tests: add extra tests on functions string_strcmp_ignore_chars and string_convert_escaped_chars
Diffstat (limited to 'tests/unit/core')
-rw-r--r--tests/unit/core/test-core-string.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/unit/core/test-core-string.cpp b/tests/unit/core/test-core-string.cpp
index d3e22cdeb..93cc316ae 100644
--- a/tests/unit/core/test-core-string.cpp
+++ b/tests/unit/core/test-core-string.cpp
@@ -498,6 +498,10 @@ TEST(CoreString, Comparison)
".-", 0));
LONGS_EQUAL(1, string_strcmp_ignore_chars ("abc..abc", "ABC-.-.ABC",
".-", 1));
+ LONGS_EQUAL(0, string_strcmp_ignore_chars (".abc..abc", "..abcabc", ".", 0));
+ LONGS_EQUAL(1, string_strcmp_ignore_chars (".abc..abc", "..", ".", 0));
+ LONGS_EQUAL(-1, string_strcmp_ignore_chars (".", "..abcabc", ".", 0));
+ LONGS_EQUAL(0, string_strcmp_ignore_chars (".", ".", ".", 0));
}
/*
@@ -875,12 +879,15 @@ TEST(CoreString, ConvertEscapedChars)
string_convert_escaped_chars ("\\0123")); /* invalid */
WEE_TEST_STR("\x41", string_convert_escaped_chars ("\\x41"));
WEE_TEST_STR("\x04z", string_convert_escaped_chars ("\\x4z"));
+ WEE_TEST_STR("xzzy", string_convert_escaped_chars ("\\xzzy"));
WEE_TEST_STR(" zz", string_convert_escaped_chars ("\\u20zz"));
WEE_TEST_STR("\U00012345", string_convert_escaped_chars ("\\U00012345"));
WEE_TEST_STR("\U00000123zzz",
string_convert_escaped_chars ("\\U00123zzz"));
WEE_TEST_STR("",
string_convert_escaped_chars ("\\U12345678")); /* invalid */
+ WEE_TEST_STR("Uzzy", string_convert_escaped_chars ("\\Uzzy"));
+ WEE_TEST_STR("\\~zzy", string_convert_escaped_chars ("\\~zzy"));
}
/*