declare smobs in alloc.c
[bpt/emacs.git] / test / rmailmm.el
CommitLineData
394c65f1
GM
1;;; rmailmm.el --- tests for mail/rmailmm.el
2
ba318903 3;; Copyright (C) 2006-2014 Free Software Foundation, Inc.
394c65f1
GM
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