diff options
author | Vincent Richard <[email protected]> | 2013-03-11 09:05:09 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2013-03-11 09:05:09 +0000 |
commit | 32a80f6c1ed501ceb2e1d7613dcdcce6cdf6fe23 (patch) | |
tree | 72f7ac0894025d16b8dca950fdfe2df97972faf6 /tests/parser/mailboxTest.cpp | |
parent | Refactored unit tests. (diff) | |
download | vmime-32a80f6c1ed501ceb2e1d7613dcdcce6cdf6fe23.tar.gz vmime-32a80f6c1ed501ceb2e1d7613dcdcce6cdf6fe23.zip |
Fixed mailbox and mailbox group parsing. Added unit tests.
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 |