aboutsummaryrefslogtreecommitdiffstats
path: root/tests/parser/textTest.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2014-06-30 20:48:42 +0000
committerVincent Richard <[email protected]>2014-06-30 20:48:42 +0000
commit03a0e36e91070a1bcfb13babaaefec4ea258723e (patch)
tree4e61cb82e31c9dac38265fac988be87c07ec94fb /tests/parser/textTest.cpp
parentAllow choosing between encoding modes for parameter values. (diff)
downloadvmime-03a0e36e91070a1bcfb13babaaefec4ea258723e.tar.gz
vmime-03a0e36e91070a1bcfb13babaaefec4ea258723e.zip
Added support for language specification in RFC-2047 encoded words and RFC-2231 parameter values.
Diffstat (limited to 'tests/parser/textTest.cpp')
-rw-r--r--tests/parser/textTest.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/parser/textTest.cpp b/tests/parser/textTest.cpp
index f56f972d..58d5bff5 100644
--- a/tests/parser/textTest.cpp
+++ b/tests/parser/textTest.cpp
@@ -221,12 +221,21 @@ VMIME_TEST_SUITE_BEGIN(textTest)
VASSERT_EQ("6", "[text: [[word: charset=iso-8859-1, buffer=Know wh\xe4t? It works!]]]",
parseText("=?iso-8859-1?Q?Know_wh=E4t?_It_works!?="));
- // TODO: add more
+ // With language specifier
+ VASSERT_EQ("7", "[text: [[word: charset=US-ASCII, buffer=Keith Moore, lang=EN]]]",
+ parseText("=?US-ASCII*EN?Q?Keith_Moore?="));
}
void testGenerate()
{
// TODO
+
+ // With language specifier
+ vmime::word wlang1("Émeline", vmime::charset("UTF-8"), "FR");
+ VASSERT_EQ("lang1", "=?UTF-8*FR?Q?=C3=89meline?=", wlang1.generate());
+
+ vmime::word wlang2("Keith Moore", vmime::charset("US-ASCII"), "EN");
+ VASSERT_EQ("lang2", "=?US-ASCII*EN?Q?Keith_Moore?=", wlang2.generate());
}
void testDisplayForm()