aboutsummaryrefslogtreecommitdiffstats
path: root/tests/parser/headerFieldTest.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2013-03-24 09:02:23 +0000
committerVincent Richard <[email protected]>2013-03-24 09:02:23 +0000
commit84415da8e1c6a650373115ba2772b0a72155b80e (patch)
tree81a4089b53e005f11a0430e70679b31af5a37a04 /tests/parser/headerFieldTest.cpp
parentFixed whitespace parsing before word. (diff)
downloadvmime-84415da8e1c6a650373115ba2772b0a72155b80e.tar.gz
vmime-84415da8e1c6a650373115ba2772b0a72155b80e.zip
Fixed parsing header field value on next line.
Diffstat (limited to 'tests/parser/headerFieldTest.cpp')
-rw-r--r--tests/parser/headerFieldTest.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/parser/headerFieldTest.cpp b/tests/parser/headerFieldTest.cpp
index c152690f..9d8f9dfa 100644
--- a/tests/parser/headerFieldTest.cpp
+++ b/tests/parser/headerFieldTest.cpp
@@ -28,6 +28,7 @@ VMIME_TEST_SUITE_BEGIN(headerFieldTest)
VMIME_TEST_LIST_BEGIN
VMIME_TEST(testBadValueType)
+ VMIME_TEST(testValueOnNextLine)
VMIME_TEST_LIST_END
@@ -49,4 +50,20 @@ VMIME_TEST_SUITE_BEGIN(headerFieldTest)
custom->setValue(vmime::text("field value text")));
}
+ void testValueOnNextLine()
+ {
+ 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", "field data", hvalue->getWholeBuffer());
+ }
+
VMIME_TEST_SUITE_END