summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/quoted-printable.scm13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/quoted-printable.scm b/tests/quoted-printable.scm
index e41eced..334380d 100755
--- a/tests/quoted-printable.scm
+++ b/tests/quoted-printable.scm
@@ -41,6 +41,9 @@
(ucs-range->char-set 33 127))
str))
+(define (quoted-printable-escape-encode-char chr)
+ (format #f "=~:@(~2,'0x~)" (char->integer chr)))
+
(test-begin "quoted-printable")
(let ((decoded-text
@@ -66,11 +69,13 @@ abriquent pour te la vendre une =C3=A2me vulgaire.")
(quoted-printable-encode
(string->bytevector decoded-text charset)))))
-(test-equal "quoted-printable encoding of ="
+(test-equal "quoted-printable encoding of special characters"
(quoted-printable-encode
- (string->bytevector "=" "UTF-8"))
- (string-append "=" (string-upcase (number->string
- (char->integer #\=) 16))))
+ (string->bytevector "=\r\n" "UTF-8"))
+ (string-append
+ (quoted-printable-escape-encode-char #\=)
+ (quoted-printable-escape-encode-char #\return)
+ (quoted-printable-escape-encode-char #\newline)))
(let ((x (random-bytevector 1000)))
(test-equal "quoted-printable random bytevector: quoted-printable-encode and quoted-printable-decode are inverses of each other"