aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndrew Whatson2023-01-03 22:19:42 +1000
committerArun Isaac2023-01-03 13:27:37 +0000
commit8a9c14473f0ae449bfbfe77ba680734e4a14562f (patch)
tree48db47d01165133aea6f7ba4093529ec744374f7 /tests
parentf49a4e54acfced1a2a6c5f06caeab42f3eeceaf0 (diff)
downloadguile-email-8a9c14473f0ae449bfbfe77ba680734e4a14562f.tar.gz
guile-email-8a9c14473f0ae449bfbfe77ba680734e4a14562f.tar.lz
guile-email-8a9c14473f0ae449bfbfe77ba680734e4a14562f.zip
email: Support quoted-printable CR LF sequences.
* email/quoted-printable.scm (quoted-printable-decode): Ignore "=\r\n" sequences in the input. * tests/quoted-printable.scm ("quoted-printable decoding of soft line breaks (=\\n)", "quoted-printable decoding of soft line breaks (=\\r\\n)"): New tests. Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
Diffstat (limited to 'tests')
-rw-r--r--tests/quoted-printable.scm7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/quoted-printable.scm b/tests/quoted-printable.scm
index bfbd985..415feb0 100644
--- a/tests/quoted-printable.scm
+++ b/tests/quoted-printable.scm
@@ -1,5 +1,6 @@
;;; guile-email --- Guile email parser
;;; Copyright © 2018, 2020 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2023 Andrew Whatson <whatson@tailcall.au>
;;;
;;; This file is part of guile-email.
;;;
@@ -67,6 +68,12 @@ abriquent pour te la vendre une =C3=A2me vulgaire.")
(quoted-printable-escape-encode-char #\return)
(quoted-printable-escape-encode-char #\newline)))
+(test-equal "quoted-printable decoding of soft line breaks (=\\n)"
+ (quoted-printable-decode "=\n") #vu8())
+
+(test-equal "quoted-printable decoding of soft line breaks (=\\r\\n)"
+ (quoted-printable-decode "=\r\n") #vu8())
+
(test-assert "quoted-printable random bytevector: quoted-printable-encode and quoted-printable-decode are inverses of each other"
(every (lambda (len)
(let ((x (random-bytevector len)))