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.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/tests/parser/mailboxTest.cpp b/tests/parser/mailboxTest.cpp
index 9e48a235..e6e4a608 100644
--- a/tests/parser/mailboxTest.cpp
+++ b/tests/parser/mailboxTest.cpp
@@ -24,15 +24,12 @@
#include "tests/testUtils.hpp"
-#define VMIME_TEST_SUITE mailboxTest
-#define VMIME_TEST_SUITE_MODULE "Parser"
-
-
-VMIME_TEST_SUITE_BEGIN
+VMIME_TEST_SUITE_BEGIN(mailboxTest)
VMIME_TEST_LIST_BEGIN
VMIME_TEST(testParse)
VMIME_TEST(testEmptyEmailAddress)
+ VMIME_TEST(testSeparatorInComment)
VMIME_TEST_LIST_END
@@ -128,5 +125,22 @@ VMIME_TEST_SUITE_BEGIN
VASSERT_EQ("email", "", mbox->getEmail());
}
+ void testSeparatorInComment()
+ {
+ vmime::addressList addrList;
+ addrList.parse("aaa(comment,comment)@vmime.org, [email protected]");
+
+ VASSERT_EQ("count", 2, addrList.getAddressCount());
+
+ vmime::ref <vmime::mailbox> mbox1 = addrList.getAddressAt(0).dynamicCast <vmime::mailbox>();
+ vmime::ref <vmime::mailbox> mbox2 = addrList.getAddressAt(1).dynamicCast <vmime::mailbox>();
+
+ VASSERT_EQ("name1", vmime::text(), mbox1->getName());
+ VASSERT_EQ("email1", "[email protected]", mbox1->getEmail());
+
+ VASSERT_EQ("name2", vmime::text(), mbox2->getName());
+ VASSERT_EQ("email2", "[email protected]", mbox2->getEmail());
+ }
+
VMIME_TEST_SUITE_END