diff options
author | Vincent Richard <[email protected]> | 2015-05-03 17:17:00 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2015-05-03 17:17:00 +0000 |
commit | e88b8eeac27ec3a829a4622c861a9018b9baa329 (patch) | |
tree | b8d6a34cc993b33f97dc1cd2937517a754e1af70 /tests/parser/emailAddressTest.cpp | |
parent | Fixed compilation issue on VS13. (diff) | |
download | vmime-e88b8eeac27ec3a829a4622c861a9018b9baa329.tar.gz vmime-e88b8eeac27ec3a829a4622c861a9018b9baa329.zip |
Fixed parsing of UTF8 email addresses (RFC-2047 local part + IDNA domain name).
Diffstat (limited to 'tests/parser/emailAddressTest.cpp')
-rw-r--r-- | tests/parser/emailAddressTest.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/parser/emailAddressTest.cpp b/tests/parser/emailAddressTest.cpp index 4916aaa9..2de401a9 100644 --- a/tests/parser/emailAddressTest.cpp +++ b/tests/parser/emailAddressTest.cpp @@ -40,6 +40,7 @@ VMIME_TEST_SUITE_BEGIN(emailAddressTest) VMIME_TEST(testParseSpecialChars) VMIME_TEST(testParseCommentInLocalPart) VMIME_TEST(testParseCommentInDomainPart) + VMIME_TEST(testParseRFC2047EncodedLocalPart) VMIME_TEST(testGenerateSpecialChars) VMIME_TEST_LIST_END @@ -198,6 +199,21 @@ VMIME_TEST_SUITE_BEGIN(emailAddressTest) VASSERT_EQ("4/domain", "example.com", eml4.getDomainName()); } + void testParseRFC2047EncodedLocalPart() + { + vmime::emailAddress eml1("[email protected]"); + VASSERT_EQ("1/local", "Pelé", eml1.getLocalName()); + VASSERT_EQ("1/domain", "example.com", eml1.getDomainName()); + + vmime::emailAddress eml2("[email protected]"); + VASSERT_EQ("2/local", "甲斐", eml2.getLocalName()); + VASSERT_EQ("2/domain", "黒川.日本", eml2.getDomainName()); + + vmime::emailAddress eml3("[email protected]"); + VASSERT_EQ("3/local", "甲斐", eml3.getLocalName()); + VASSERT_EQ("3/domain", "黒川.com", eml3.getDomainName()); + } + void testGenerateASCII() { VASSERT_EQ("email 1", "local@domain", vmime::emailAddress("local", "domain").generate()); |