aboutsummaryrefslogtreecommitdiffstats
path: root/tests/parser/mailboxTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/parser/mailboxTest.cpp')
-rw-r--r--tests/parser/mailboxTest.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/tests/parser/mailboxTest.cpp b/tests/parser/mailboxTest.cpp
index 127bb422..a0d1b694 100644
--- a/tests/parser/mailboxTest.cpp
+++ b/tests/parser/mailboxTest.cpp
@@ -30,7 +30,7 @@ VMIME_TEST_SUITE_BEGIN(mailboxTest)
VMIME_TEST(testParse)
VMIME_TEST(testEmptyEmailAddress)
VMIME_TEST(testSeparatorInComment)
- VMIME_TEST(testAddressInName)
+ VMIME_TEST(testMalformations)
VMIME_TEST_LIST_END
@@ -146,13 +146,28 @@ VMIME_TEST_SUITE_BEGIN(mailboxTest)
VASSERT_EQ("email2", "[email protected]", mbox2->getEmail());
}
- void testAddressInName() {
-
+ void testMalformations() {
vmime::mailbox mbox;
VASSERT_EQ("name", vmime::text("[email protected]"), mbox.getName());
VASSERT_EQ("email", "[email protected]", mbox.getEmail());
+
+ VASSERT_EQ("name", vmime::text("[email protected]"), mbox.getName());
+ VASSERT_EQ("email", "[email protected]", mbox.getEmail());
+
+ mbox.parse("Foo <bar<[email protected]>");
+ VASSERT_EQ("name", vmime::text("Foobar"), mbox.getName());
+ VASSERT_EQ("email", "[email protected]", mbox.getEmail());
+
+ mbox.parse("Foo <[email protected]> <[email protected]>");
+ VASSERT_EQ("name", vmime::text("Foo"), mbox.getName());
+ VASSERT_EQ("email", "[email protected]", mbox.getEmail());
+
+ mbox.parse("Foo <[email protected]> Bar <[email protected]>");
+ VASSERT_EQ("name", vmime::text("Foo"), mbox.getName());
+ VASSERT_EQ("email", "[email protected]", mbox.getEmail());
}
VMIME_TEST_SUITE_END