summaryrefslogtreecommitdiff
path: root/test/lisp/gnus/mm-decode-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp/gnus/mm-decode-tests.el')
-rw-r--r--test/lisp/gnus/mm-decode-tests.el18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/lisp/gnus/mm-decode-tests.el b/test/lisp/gnus/mm-decode-tests.el
index 976e7269b14..74591f919da 100644
--- a/test/lisp/gnus/mm-decode-tests.el
+++ b/test/lisp/gnus/mm-decode-tests.el
@@ -54,7 +54,7 @@
'charset)))
"<!doctype html><html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\"></head><body>ääää</body></html>\n")))))))
-(ert-deftest test-mm-with-part ()
+(ert-deftest test-mm-with-part-unibyte ()
(with-temp-buffer
(set-buffer-multibyte nil)
(insert-file-contents-literally (ert-resource-file "8bit-multipart.bin"))
@@ -70,4 +70,20 @@
'charset)))
"ääää\n"))))))
+(ert-deftest test-mm-with-part-multibyte ()
+ (with-temp-buffer
+ (set-buffer-multibyte t)
+ (nnheader-insert-file-contents (ert-resource-file "8bit-multipart.bin"))
+ (while (search-forward "\r\n" nil t)
+ (replace-match "\n"))
+ (let ((handle (mm-dissect-buffer)))
+ (pop handle)
+ (let ((part (pop handle)))
+ (should (equal (decode-coding-string
+ (mm-with-part part
+ (buffer-string))
+ (intern (mail-content-type-get (mm-handle-type part)
+ 'charset)))
+ "ääää\n"))))))
+
;;; mm-decode-tests.el ends here