summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2018-11-14 00:23:07 +0530
committerArun Isaac2018-11-14 00:23:07 +0530
commit6f15087ac668f49e31bd1d138f67438b8e9e49ed (patch)
tree18b3e0fd2446b466ad22c2bd51509f4ef6676af0
parent2448f2500e04190206c27812475f83df08439d1b (diff)
downloadguile-email-6f15087ac668f49e31bd1d138f67438b8e9e49ed.tar.gz
guile-email-6f15087ac668f49e31bd1d138f67438b8e9e49ed.tar.lz
guile-email-6f15087ac668f49e31bd1d138f67438b8e9e49ed.zip
tests: Add tests for decoding MIME encoded words.
* tests/email.scm ("decode MIME encoded word: wikipedia example", "decode MIME encoded phrases that mix ASCII text and MIME encoded words"): New tests.
-rw-r--r--tests/email.scm12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/email.scm b/tests/email.scm
index a91ab16..a2a38df 100644
--- a/tests/email.scm
+++ b/tests/email.scm
@@ -126,4 +126,16 @@ foo
(parse-email-address "foo@example.org (Foo)")
'((name . "Foo") (address . "foo@example.org")))
+(test-equal "decode MIME encoded word: wikipedia example"
+ ((module-ref (resolve-module '(email email))
+ 'decode-mime-encoded-word)
+ "=?iso-8859-1?Q?=A1Hola,_se=F1or!?=")
+ "¡Hola, señor!")
+
+(test-equal "decode MIME encoded phrases that mix ASCII text and MIME encoded words"
+ ((module-ref (resolve-module '(email email))
+ 'decode-mime-encoded-word)
+ "Foo =?UTF-8?Q?B=C3=A3r?=")
+ "Foo Bãr")
+
(test-end "email")