aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArun Isaac2018-09-12 17:56:13 +0530
committerArun Isaac2018-09-12 17:57:51 +0530
commit81c3ae5e6d80efd3c87f42552876697c498005d2 (patch)
treea109d1533340d5e248523fb6c1dd74f517a960aa /tests
parent2784c121d5a3c9d8e7831c883edac3b6857bc198 (diff)
downloadguile-email-81c3ae5e6d80efd3c87f42552876697c498005d2.tar.gz
guile-email-81c3ae5e6d80efd3c87f42552876697c498005d2.tar.lz
guile-email-81c3ae5e6d80efd3c87f42552876697c498005d2.zip
quoted-printable: Add q-encoding-encode.
* email/quoted-printable.scm (q-encoding-encode): New function. * tests/quoted-printable.scm (q-encoding wikipedia example): Rename to ... (q-encoding wikipedia example: decoding): ... this. (q-encoding wikipedia example: encoding): New test.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/quoted-printable.scm18
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/quoted-printable.scm b/tests/quoted-printable.scm
index a0f0369..608a937 100755
--- a/tests/quoted-printable.scm
+++ b/tests/quoted-printable.scm
@@ -49,10 +49,18 @@ abriquent pour te la vendre une =C3=A2me vulgaire.")
(string->bytevector decoded-text charset))
#\newline))))
-(test-equal "q-encoding wikipedia example"
- (bytevector->string
- (q-encoding-decode "=A1Hola,_se=F1or!")
- "ISO-8859-1")
- "¡Hola, señor!")
+(let ((encoded-text "=A1Hola,_se=F1or!")
+ (decoded-text "¡Hola, señor!")
+ (charset "ISO-8859-1"))
+ (test-equal "q-encoding wikipedia example: decoding"
+ (q-encoding-encode
+ (string->bytevector decoded-text charset))
+ encoded-text)
+
+ (test-equal "q-encoding wikipedia example: encoding"
+ (bytevector->string
+ (q-encoding-decode encoded-text)
+ charset)
+ decoded-text))
(test-end "quoted-printable")