diff options
Diffstat (limited to 'tests/parser/mailboxTest.cpp')
-rw-r--r-- | tests/parser/mailboxTest.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/parser/mailboxTest.cpp b/tests/parser/mailboxTest.cpp index a6e46577..e6e4a608 100644 --- a/tests/parser/mailboxTest.cpp +++ b/tests/parser/mailboxTest.cpp @@ -29,6 +29,7 @@ VMIME_TEST_SUITE_BEGIN(mailboxTest) VMIME_TEST_LIST_BEGIN VMIME_TEST(testParse) VMIME_TEST(testEmptyEmailAddress) + VMIME_TEST(testSeparatorInComment) VMIME_TEST_LIST_END @@ -124,5 +125,22 @@ VMIME_TEST_SUITE_BEGIN(mailboxTest) 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 |