summaryrefslogtreecommitdiff
path: root/test/lisp/mail
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2022-05-14 11:30:54 +0300
committerEli Zaretskii <eliz@gnu.org>2022-05-14 11:30:54 +0300
commit9a67e83bd656477e46015c629f3e961e22791a88 (patch)
tree946c0cbda9c0789b6b4a4cd723e33a97d609c47b /test/lisp/mail
parente2e081a476a2a9309d0870e4c1adda1167c52911 (diff)
downloademacs-9a67e83bd656477e46015c629f3e961e22791a88.tar.gz
Fix undigest-tests on MS-Windows
* lisp/emacs-lisp/ert-x.el (ert-with-temp-file): Accept a new keyword argument :coding CODING to use as the encoding when writing initial text to the temporary file. * test/lisp/mail/undigest-tests.el (rmail-undigest-test-rfc934-digest) (rmail-undigest-test-rfc1153-digest-strict) (rmail-undigest-test-rfc1153-less-strict-digest) (rmail-undigest-test-rfc1153-sloppy-digest) (rmail-undigest-test-rfc1521-mime-digest) (rmail-undigest-test-multipart-mixed-digest): Force the temporary mbox files to have Unix-style EOL format.
Diffstat (limited to 'test/lisp/mail')
-rw-r--r--test/lisp/mail/undigest-tests.el18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/lisp/mail/undigest-tests.el b/test/lisp/mail/undigest-tests.el
index 1c473c4996f..d52c9f9c5ab 100644
--- a/test/lisp/mail/undigest-tests.el
+++ b/test/lisp/mail/undigest-tests.el
@@ -273,6 +273,9 @@ The footer.
"Test that we can undigest a RFC 934 digest."
(ert-with-temp-file file
:text rmail-rfc934-digest
+ ;; Rmail reads mbox files literally, so we must make sure the
+ ;; temporary mbox file has Unix-style EOLs.
+ :coding 'undecided-unix
(rmail file)
(undigestify-rmail-message)
(should (= rmail-total-messages 4))
@@ -285,6 +288,9 @@ The footer.
:expected-result :failed
(ert-with-temp-file file
:text rmail-rfc1153-digest-strict
+ ;; Rmail reads mbox files literally, so we must make sure the
+ ;; temporary mbox file has Unix-style EOLs.
+ :coding 'undecided-unix
(rmail file)
(should
(ignore-errors
@@ -300,6 +306,9 @@ The footer.
"Test that we can undigest a RFC 1153 with a Subject header in its footer."
(ert-with-temp-file file
:text rmail-rfc1153-digest-less-strict
+ ;; Rmail reads mbox files literally, so we must make sure the
+ ;; temporary mbox file has Unix-style EOLs.
+ :coding 'undecided-unix
(rmail file)
(undigestify-rmail-message)
(should (= rmail-total-messages 5))
@@ -310,6 +319,9 @@ The footer.
"Test that we can undigest a sloppy RFC 1153 digest."
(ert-with-temp-file file
:text rmail-rfc1153-digest-sloppy
+ ;; Rmail reads mbox files literally, so we must make sure the
+ ;; temporary mbox file has Unix-style EOLs.
+ :coding 'undecided-unix
(rmail file)
(undigestify-rmail-message)
(should (= rmail-total-messages 5))
@@ -324,6 +336,9 @@ The footer.
:expected-result :failed
(ert-with-temp-file file
:text rmail-rfc1521-mime-digest
+ ;; Rmail reads mbox files literally, so we must make sure the
+ ;; temporary mbox file has Unix-style EOLs.
+ :coding 'undecided-unix
(rmail file)
(undigestify-rmail-message)
(should (= rmail-total-messages 3))
@@ -334,6 +349,9 @@ The footer.
"Test that we can undigest a digest inside a multipart/mixed digest."
(ert-with-temp-file file
:text rmail-multipart-mixed-digest
+ ;; Rmail reads mbox files literally, so we must make sure the
+ ;; temporary mbox file has Unix-style EOLs.
+ :coding 'undecided-unix
(rmail file)
(undigestify-rmail-message)
(should (= rmail-total-messages 4))