summaryrefslogtreecommitdiff
path: root/tests/unit/core/test-core-string.cpp
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-08-23 12:14:07 +0200
committerSébastien Helleu <flashcode@flashtux.org>2023-08-23 12:14:07 +0200
commit9462c87ce5aa0ead85d123f5e1fed94e8a1656ed (patch)
treee8cc06a9fdd9d99846ca6c293b2e5eeb2948e9f0 /tests/unit/core/test-core-string.cpp
parent03927a3283d0f4d3c432d0a6c21f0f5261015b3c (diff)
downloadweechat-9462c87ce5aa0ead85d123f5e1fed94e8a1656ed.zip
tests: add tests on string comparison functions with range of 29 chars
Diffstat (limited to 'tests/unit/core/test-core-string.cpp')
-rw-r--r--tests/unit/core/test-core-string.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/unit/core/test-core-string.cpp b/tests/unit/core/test-core-string.cpp
index 465276c66..a267a1bc4 100644
--- a/tests/unit/core/test-core-string.cpp
+++ b/tests/unit/core/test-core-string.cpp
@@ -499,6 +499,11 @@ TEST(CoreString, CharComparison)
LONGS_EQUAL(0, string_charcasecmp_range ("]", "}", 30));
LONGS_EQUAL(0, string_charcasecmp_range ("\\", "|", 30));
LONGS_EQUAL(0, string_charcasecmp_range ("^", "~", 30));
+ LONGS_EQUAL(0, string_charcasecmp_range ("[", "{", 29));
+ LONGS_EQUAL(0, string_charcasecmp_range ("]", "}", 29));
+ LONGS_EQUAL(0, string_charcasecmp_range ("\\", "|", 29));
+ LONGS_EQUAL(-32, string_charcasecmp_range ("^", "~", 29));
+ LONGS_EQUAL(32, string_charcasecmp_range ("~", "^", 29));
LONGS_EQUAL(-32, string_charcasecmp_range ("[", "{", 26));
LONGS_EQUAL(32, string_charcasecmp_range ("{", "[", 26));
LONGS_EQUAL(-32, string_charcasecmp_range ("]", "}", 26));
@@ -628,6 +633,11 @@ TEST(CoreString, StringComparison)
LONGS_EQUAL(0, string_strcasecmp_range ("]", "}", 30));
LONGS_EQUAL(0, string_strcasecmp_range ("\\", "|", 30));
LONGS_EQUAL(0, string_strcasecmp_range ("^", "~", 30));
+ LONGS_EQUAL(0, string_strcasecmp_range ("[", "{", 29));
+ LONGS_EQUAL(0, string_strcasecmp_range ("]", "}", 29));
+ LONGS_EQUAL(0, string_strcasecmp_range ("\\", "|", 29));
+ LONGS_EQUAL(-32, string_strcasecmp_range ("^", "~", 29));
+ LONGS_EQUAL(32, string_strcasecmp_range ("~", "^", 29));
LONGS_EQUAL(-32, string_strcasecmp_range ("[", "{", 26));
LONGS_EQUAL(32, string_strcasecmp_range ("{", "[", 26));
LONGS_EQUAL(-32, string_strcasecmp_range ("]", "}", 26));
@@ -661,6 +671,11 @@ TEST(CoreString, StringComparison)
LONGS_EQUAL(0, string_strncasecmp_range ("^^^", "~~~", 3, 30));
LONGS_EQUAL(0, string_strncasecmp_range ("^^^abc", "~~~def", 3, 30));
LONGS_EQUAL(-3, string_strncasecmp_range ("^^^abc", "~~~def", 6, 30));
+ LONGS_EQUAL(0, string_strncasecmp_range ("[[[", "{{{", 3, 29));
+ LONGS_EQUAL(0, string_strncasecmp_range ("]]]", "}}}", 3, 29));
+ LONGS_EQUAL(0, string_strncasecmp_range ("\\\\\\", "|||", 3, 29));
+ LONGS_EQUAL(-32, string_strncasecmp_range ("^^^", "~~~", 3, 29));
+ LONGS_EQUAL(32, string_strncasecmp_range ("~~~", "^^^", 3, 29));
LONGS_EQUAL(-32, string_strncasecmp_range ("[[[", "{{{", 3, 26));
LONGS_EQUAL(-32, string_strncasecmp_range ("]]]", "}}}", 3, 26));
LONGS_EQUAL(-32, string_strncasecmp_range ("\\\\\\", "|||", 3, 26));