aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2011-11-21 21:55:06 -0500
committerGlenn Morris2011-11-21 21:55:06 -0500
commit394c65f1c1431645a7ff07afffaac3ce6ac9d55e (patch)
tree55ae8c7ec8add53054bb48e8de58a43b76c2bf3f
parenta3e0ee5a69ae6b442494c3a62880db5168405b18 (diff)
downloademacs-394c65f1c1431645a7ff07afffaac3ce6ac9d55e.tar.gz
emacs-394c65f1c1431645a7ff07afffaac3ce6ac9d55e.zip
Move rmailmm test functions to test/ directory.
* lisp/mail/rmailmm.el (test-rmail-mime-handler) (test-rmail-mime-bulk-handler) (test-rmail-mime-multipart-handler): Move tests to test/ directory. * test/rmailmm.el: New file, split from lisp/mail/rmailmm.el.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/mail/rmailmm.el69
-rw-r--r--test/ChangeLog4
-rw-r--r--test/rmailmm.el93
4 files changed, 103 insertions, 69 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9293a66c394..37ecd3e6852 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12011-11-22 Glenn Morris <rgm@gnu.org>
2
3 * mail/rmailmm.el (test-rmail-mime-handler)
4 (test-rmail-mime-bulk-handler)
5 (test-rmail-mime-multipart-handler): Move tests to test/ directory.
6
12011-11-21 Juri Linkov <juri@jurta.org> 72011-11-21 Juri Linkov <juri@jurta.org>
2 8
3 * calc/calc.el (calc-read-key-sequence): Let-bind `input-method-function' 9 * calc/calc.el (calc-read-key-sequence): Let-bind `input-method-function'
diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el
index 31e34cd098f..e53e0c0744e 100644
--- a/lisp/mail/rmailmm.el
+++ b/lisp/mail/rmailmm.el
@@ -612,23 +612,6 @@ HEADER is a header component of a MIME-entity object (see
612 (rmail-mime-insert-decoded-text entity))) 612 (rmail-mime-insert-decoded-text entity)))
613 (put-text-property beg (point) 'rmail-mime-entity entity))) 613 (put-text-property beg (point) 'rmail-mime-entity entity)))
614 614
615;; FIXME move to the test/ directory?
616(defun test-rmail-mime-handler ()
617 "Test of a mail using no MIME parts at all."
618 (let ((mail "To: alex@gnu.org
619Content-Type: text/plain; charset=koi8-r
620Content-Transfer-Encoding: 8bit
621MIME-Version: 1.0
622
623\372\304\322\301\327\323\324\327\325\312\324\305\41"))
624 (switch-to-buffer (get-buffer-create "*test*"))
625 (erase-buffer)
626 (set-buffer-multibyte nil)
627 (insert mail)
628 (rmail-mime-show t)
629 (set-buffer-multibyte t)))
630
631
632(defun rmail-mime-insert-image (entity) 615(defun rmail-mime-insert-image (entity)
633 "Decode and insert the image body of MIME-entity ENTITY." 616 "Decode and insert the image body of MIME-entity ENTITY."
634 (let* ((content-type (car (rmail-mime-entity-type entity))) 617 (let* ((content-type (car (rmail-mime-entity-type entity)))
@@ -813,27 +796,6 @@ directly."
813 (rmail-mime-insert-decoded-text entity))))) 796 (rmail-mime-insert-decoded-text entity)))))
814 (put-text-property beg (point) 'rmail-mime-entity entity))) 797 (put-text-property beg (point) 'rmail-mime-entity entity)))
815 798
816(defun test-rmail-mime-bulk-handler ()
817 "Test of a mail used as an example in RFC 2183."
818 (let ((mail "Content-Type: image/jpeg
819Content-Disposition: attachment; filename=genome.jpeg;
820 modification-date=\"Wed, 12 Feb 1997 16:29:51 -0500\";
821Content-Description: a complete map of the human genome
822Content-Transfer-Encoding: base64
823
824iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAABGdBTUEAALGPC/xhBQAAAAZQ
825TFRF////AAAAVcLTfgAAAPZJREFUeNq9ldsOwzAIQ+3//+l1WlvA5ZLsoUiTto4TB+ISoAjy
826+ITfRBfcAmgRFFeAm+J6uhdKdFhFWUgDkFsK0oUp/9G2//Kj7Jx+5tSKOdBscgUYiKHRS/me
827WATQdRUvAK0Bnmshmtn79PpaLBbbOZkjKvRnjRZoRswOkG1wFchKew2g9wXVJVZL/m4+B+vv
8289AxQQR2Q33SgAYJzzVACdAWjAfRYzYFO9n6SLnydtQHSMxYDMAKqZ/8FS/lTK+zuq3CtK64L
829UDwbgUEAUmk2Zyg101d6PhCDySgAvTvDgKiuOrc4dLxUb7UMnhGIexyI+d6U+ABuNAP4Simx
830lgAAAABJRU5ErkJggg==
831"))
832 (switch-to-buffer (get-buffer-create "*test*"))
833 (erase-buffer)
834 (insert mail)
835 (rmail-mime-show)))
836
837(defun rmail-mime-multipart-handler (content-type 799(defun rmail-mime-multipart-handler (content-type
838 content-disposition 800 content-disposition
839 content-transfer-encoding) 801 content-transfer-encoding)
@@ -971,37 +933,6 @@ The other arguments are the same as `rmail-mime-multipart-handler'."
971 (rmail-mime-hidden-mode child))))) 933 (rmail-mime-hidden-mode child)))))
972 entities))) 934 entities)))
973 935
974(defun test-rmail-mime-multipart-handler ()
975 "Test of a mail used as an example in RFC 2046."
976 (let ((mail "From: Nathaniel Borenstein <nsb@bellcore.com>
977To: Ned Freed <ned@innosoft.com>
978Date: Sun, 21 Mar 1993 23:56:48 -0800 (PST)
979Subject: Sample message
980MIME-Version: 1.0
981Content-type: multipart/mixed; boundary=\"simple boundary\"
982
983This is the preamble. It is to be ignored, though it
984is a handy place for composition agents to include an
985explanatory note to non-MIME conformant readers.
986
987--simple boundary
988
989This is implicitly typed plain US-ASCII text.
990It does NOT end with a linebreak.
991--simple boundary
992Content-type: text/plain; charset=us-ascii
993
994This is explicitly typed plain US-ASCII text.
995It DOES end with a linebreak.
996
997--simple boundary--
998
999This is the epilogue. It is also to be ignored."))
1000 (switch-to-buffer (get-buffer-create "*test*"))
1001 (erase-buffer)
1002 (insert mail)
1003 (rmail-mime-show t)))
1004
1005(defun rmail-mime-insert-multipart (entity) 936(defun rmail-mime-insert-multipart (entity)
1006 "Presentation handler for a multipart MIME entity." 937 "Presentation handler for a multipart MIME entity."
1007 (let ((current (aref (rmail-mime-entity-display entity) 0)) 938 (let ((current (aref (rmail-mime-entity-display entity) 0))
diff --git a/test/ChangeLog b/test/ChangeLog
index 80c26a9cf44..04a70737d61 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,7 @@
12011-11-22 Glenn Morris <rgm@gnu.org>
2
3 * rmailmm.el: New file, split from lisp/mail/rmailmm.el.
4
12011-11-20 Juanma Barranquero <lekktu@gmail.com> 52011-11-20 Juanma Barranquero <lekktu@gmail.com>
2 6
3 * cedet/semantic-utest-c.el (semantic-utest-c-comparisons): Fix typo. 7 * cedet/semantic-utest-c.el (semantic-utest-c-comparisons): Fix typo.
diff --git a/test/rmailmm.el b/test/rmailmm.el
new file mode 100644
index 00000000000..97577ee35cb
--- /dev/null
+++ b/test/rmailmm.el
@@ -0,0 +1,93 @@
1;;; rmailmm.el --- tests for mail/rmailmm.el
2
3;; Copyright (C) 2006-2011 Free Software Foundation, Inc.
4
5;; This file is part of GNU Emacs.
6
7;; GNU Emacs is free software: you can redistribute it and/or modify
8;; it under the terms of the GNU General Public License as published by
9;; the Free Software Foundation, either version 3 of the License, or
10;; (at your option) any later version.
11
12;; GNU Emacs is distributed in the hope that it will be useful,
13;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;; GNU General Public License for more details.
16
17;; You should have received a copy of the GNU General Public License
18;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
19
20;;; Commentary:
21
22;;; Code:
23
24(require 'rmailmm)
25
26(defun rmailmm-test-handler ()
27 "Test of a mail using no MIME parts at all."
28 (let ((mail "To: alex@gnu.org
29Content-Type: text/plain; charset=koi8-r
30Content-Transfer-Encoding: 8bit
31MIME-Version: 1.0
32
33\372\304\322\301\327\323\324\327\325\312\324\305\41"))
34 (switch-to-buffer (get-buffer-create "*test*"))
35 (erase-buffer)
36 (set-buffer-multibyte nil)
37 (insert mail)
38 (rmail-mime-show t)
39 (set-buffer-multibyte t)))
40
41(defun rmailmm-test-bulk-handler ()
42 "Test of a mail used as an example in RFC 2183."
43 (let ((mail "Content-Type: image/jpeg
44Content-Disposition: attachment; filename=genome.jpeg;
45 modification-date=\"Wed, 12 Feb 1997 16:29:51 -0500\";
46Content-Description: a complete map of the human genome
47Content-Transfer-Encoding: base64
48
49iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAABGdBTUEAALGPC/xhBQAAAAZQ
50TFRF////AAAAVcLTfgAAAPZJREFUeNq9ldsOwzAIQ+3//+l1WlvA5ZLsoUiTto4TB+ISoAjy
51+ITfRBfcAmgRFFeAm+J6uhdKdFhFWUgDkFsK0oUp/9G2//Kj7Jx+5tSKOdBscgUYiKHRS/me
52WATQdRUvAK0Bnmshmtn79PpaLBbbOZkjKvRnjRZoRswOkG1wFchKew2g9wXVJVZL/m4+B+vv
539AxQQR2Q33SgAYJzzVACdAWjAfRYzYFO9n6SLnydtQHSMxYDMAKqZ/8FS/lTK+zuq3CtK64L
54UDwbgUEAUmk2Zyg101d6PhCDySgAvTvDgKiuOrc4dLxUb7UMnhGIexyI+d6U+ABuNAP4Simx
55lgAAAABJRU5ErkJggg==
56"))
57 (switch-to-buffer (get-buffer-create "*test*"))
58 (erase-buffer)
59 (insert mail)
60 (rmail-mime-show)))
61
62(defun rmailmm-test-multipart-handler ()
63 "Test of a mail used as an example in RFC 2046."
64 (let ((mail "From: Nathaniel Borenstein <nsb@bellcore.com>
65To: Ned Freed <ned@innosoft.com>
66Date: Sun, 21 Mar 1993 23:56:48 -0800 (PST)
67Subject: Sample message
68MIME-Version: 1.0
69Content-type: multipart/mixed; boundary=\"simple boundary\"
70
71This is the preamble. It is to be ignored, though it
72is a handy place for composition agents to include an
73explanatory note to non-MIME conformant readers.
74
75--simple boundary
76
77This is implicitly typed plain US-ASCII text.
78It does NOT end with a linebreak.
79--simple boundary
80Content-type: text/plain; charset=us-ascii
81
82This is explicitly typed plain US-ASCII text.
83It DOES end with a linebreak.
84
85--simple boundary--
86
87This is the epilogue. It is also to be ignored."))
88 (switch-to-buffer (get-buffer-create "*test*"))
89 (erase-buffer)
90 (insert mail)
91 (rmail-mime-show t)))
92
93;;; rmailmm.el ends here