aboutsummaryrefslogtreecommitdiffstats
path: root/tests/utility/stringUtilsTest.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2018-09-05 22:22:34 +0000
committerVincent Richard <[email protected]>2018-09-05 22:22:34 +0000
commitcfd4492915ef3c7f5e48c0f2aa02023efb8b506e (patch)
tree5ea3e9c9b9c14b85566c24fb146bb2e49e66a03d /tests/utility/stringUtilsTest.cpp
parentFixed bug in implementation of isStringEqualNoCase(). (diff)
downloadvmime-cfd4492915ef3c7f5e48c0f2aa02023efb8b506e.tar.gz
vmime-cfd4492915ef3c7f5e48c0f2aa02023efb8b506e.zip
More tests.
Diffstat (limited to 'tests/utility/stringUtilsTest.cpp')
-rw-r--r--tests/utility/stringUtilsTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/utility/stringUtilsTest.cpp b/tests/utility/stringUtilsTest.cpp
index 49e16434..6c2e18fb 100644
--- a/tests/utility/stringUtilsTest.cpp
+++ b/tests/utility/stringUtilsTest.cpp
@@ -91,6 +91,12 @@ VMIME_TEST_SUITE_BEGIN(stringUtilsTest)
VASSERT_EQ("3", false, stringUtils::isStringEqualNoCase(vmime::string("foo"), "FOo", 3));
VASSERT_EQ("4", false, stringUtils::isStringEqualNoCase(vmime::string("foo"), "bar", 3));
+
+ VASSERT_EQ("5", false, stringUtils::isStringEqualNoCase(vmime::string("foO"), "bar", 3));
+ VASSERT_EQ("6", false, stringUtils::isStringEqualNoCase(vmime::string("foOO"), "barO", 4));
+ VASSERT_EQ("7", false, stringUtils::isStringEqualNoCase(vmime::string("foOO"), "ba", 2));
+
+ VASSERT_EQ("8", true, stringUtils::isStringEqualNoCase(vmime::string("FOoooo"), "foo", 3));
}
void testIsStringEqualNoCase2() {
@@ -111,6 +117,8 @@ VMIME_TEST_SUITE_BEGIN(stringUtilsTest)
VASSERT_EQ("2", false, stringUtils::isStringEqualNoCase(str1.begin(), str1.end(), "FooBar", 6));
VASSERT_EQ("3", true, stringUtils::isStringEqualNoCase(str1.begin(), str1.end(), "fooBar", 3));
VASSERT_EQ("4", false, stringUtils::isStringEqualNoCase(str1.begin(), str1.begin() + 3, "fooBar", 6));
+ VASSERT_EQ("5", false, stringUtils::isStringEqualNoCase(str1.begin(), str1.begin() + 3, "bar", 3));
+ VASSERT_EQ("6", false, stringUtils::isStringEqualNoCase(str1.begin(), str1.begin() + 6, "barbar", 6));
}
void testToLower() {