aboutsummaryrefslogtreecommitdiffstats
path: root/tests/utility/stringUtilsTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/utility/stringUtilsTest.cpp')
-rw-r--r--tests/utility/stringUtilsTest.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/utility/stringUtilsTest.cpp b/tests/utility/stringUtilsTest.cpp
index a75b8ad7..8b60112d 100644
--- a/tests/utility/stringUtilsTest.cpp
+++ b/tests/utility/stringUtilsTest.cpp
@@ -42,6 +42,8 @@ VMIME_TEST_SUITE_BEGIN
VMIME_TEST(testTrim)
VMIME_TEST(testCountASCIIChars)
+
+ VMIME_TEST(testUnquote)
VMIME_TEST_LIST_END
@@ -119,5 +121,13 @@ VMIME_TEST_SUITE_BEGIN
stringUtils::countASCIIchars(str4.begin(), str4.end()));
}
+ void testUnquote()
+ {
+ VASSERT_EQ("1", "quoted", stringUtils::unquote("\"quoted\"")); // "quoted"
+ VASSERT_EQ("2", "\"not quoted", stringUtils::unquote("\"not quoted")); // "not quoted
+ VASSERT_EQ("3", "not quoted\"", stringUtils::unquote("not quoted\"")); // not quoted"
+ VASSERT_EQ("4", "quoted with \"escape\"", stringUtils::unquote("\"quoted with \\\"escape\\\"\"")); // "quoted with \"escape\""
+ }
+
VMIME_TEST_SUITE_END