aboutsummaryrefslogtreecommitdiffstats
path: root/tests/parser/emailAddressTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/parser/emailAddressTest.cpp')
-rw-r--r--tests/parser/emailAddressTest.cpp16
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());