diff options
author | Vincent Richard <[email protected]> | 2013-03-24 14:50:16 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2013-03-24 14:50:16 +0000 |
commit | 32eb1ebe34ae903b91ca0c77d616a07a2ba5afe6 (patch) | |
tree | a152314d07482903577d5e14120367f8358a41ba /tests/parser/headerFieldTest.cpp | |
parent | Fixed warnings and 64-bit issues. (diff) | |
download | vmime-32eb1ebe34ae903b91ca0c77d616a07a2ba5afe6.tar.gz vmime-32eb1ebe34ae903b91ca0c77d616a07a2ba5afe6.zip |
Strip spaces at end of header lines (Zarafa).
Diffstat (limited to '')
-rw-r--r-- | tests/parser/headerFieldTest.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/parser/headerFieldTest.cpp b/tests/parser/headerFieldTest.cpp index 9d8f9dfa..b551c781 100644 --- a/tests/parser/headerFieldTest.cpp +++ b/tests/parser/headerFieldTest.cpp @@ -29,6 +29,7 @@ VMIME_TEST_SUITE_BEGIN(headerFieldTest) VMIME_TEST_LIST_BEGIN VMIME_TEST(testBadValueType) VMIME_TEST(testValueOnNextLine) + VMIME_TEST(testStripSpacesAtEnd) VMIME_TEST_LIST_END @@ -66,4 +67,20 @@ VMIME_TEST_SUITE_BEGIN(headerFieldTest) VASSERT_EQ("Field value", "field data", hvalue->getWholeBuffer()); } + void testStripSpacesAtEnd() + { + vmime::parsingContext ctx; + + const vmime::string buffer = "Field: \r\n\tfield data "; + + vmime::ref <vmime::headerField> hfield = + vmime::headerField::parseNext(ctx, buffer, 0, buffer.size()); + + vmime::ref <vmime::text> hvalue = + hfield->getValue().dynamicCast <vmime::text>(); + + VASSERT_EQ("Field name", "Field", hfield->getName()); + VASSERT_EQ("Field value", toHex("field data"), toHex(hvalue->getWholeBuffer())); + } + VMIME_TEST_SUITE_END |