aboutsummaryrefslogtreecommitdiffstats
path: root/tests/utility/stringUtilsTest.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2007-08-30 21:38:22 +0000
committerVincent Richard <[email protected]>2007-08-30 21:38:22 +0000
commitfd0647db850118edb37d95897c40121621753ddc (patch)
treee9af5ed198958bb64294028220ecb571a28b7212 /tests/utility/stringUtilsTest.cpp
parentReset exception pointer (thanks to Emmanuel Cabestan). (diff)
downloadvmime-fd0647db850118edb37d95897c40121621753ddc.tar.gz
vmime-fd0647db850118edb37d95897c40121621753ddc.zip
Added function to unquote strings.
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