From fd0647db850118edb37d95897c40121621753ddc Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Thu, 30 Aug 2007 21:38:22 +0000 Subject: Added function to unquote strings. --- tests/utility/stringUtilsTest.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/utility/stringUtilsTest.cpp') 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 -- cgit v1.2.3