diff options
author | Vincent Richard <[email protected]> | 2019-02-04 20:10:47 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-02-04 20:10:47 +0000 |
commit | 414661858dd289338097719b32dae1f9ef3c67b6 (patch) | |
tree | 4a8a599c0e64d58818bebc761f94acdee189b847 /tests/parser/mailboxTest.cpp | |
parent | #206 Initialize and delete pointers (diff) | |
parent | Improve address parser for malformed mailbox specifications (diff) | |
download | vmime-414661858dd289338097719b32dae1f9ef3c67b6.tar.gz vmime-414661858dd289338097719b32dae1f9ef3c67b6.zip |
Merge pull request #210 from jengelh/twoaddr
Handle parsing of further non-conformant From lines
Diffstat (limited to 'tests/parser/mailboxTest.cpp')
-rw-r--r-- | tests/parser/mailboxTest.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/tests/parser/mailboxTest.cpp b/tests/parser/mailboxTest.cpp index 127bb422..23d1b4ac 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; - mbox.parse("[email protected] <[email protected]>"); + mbox.parse("[email protected] <[email protected]>"); VASSERT_EQ("name", vmime::text("[email protected]"), mbox.getName()); VASSERT_EQ("email", "[email protected]", mbox.getEmail()); + + VASSERT_EQ("name", vmime::text("[email protected] [email protected]"), mbox.getName()); + VASSERT_EQ("email", "[email protected]", mbox.getEmail()); + + mbox.parse("Foo <bar<[email protected]>"); + VASSERT_EQ("name", vmime::text("Foo <bar"), mbox.getName()); + VASSERT_EQ("email", "[email protected]", mbox.getEmail()); + + mbox.parse("Foo <[email protected]> <[email protected]>"); + VASSERT_EQ("name", vmime::text("Foo <[email protected]>"), mbox.getName()); + VASSERT_EQ("email", "[email protected]", mbox.getEmail()); + + mbox.parse("Foo <[email protected]> Bar <[email protected]>"); + VASSERT_EQ("name", vmime::text("Foo <[email protected]> Bar"), mbox.getName()); + VASSERT_EQ("email", "[email protected]", mbox.getEmail()); } VMIME_TEST_SUITE_END |