]>
diplodocus.org Git - nmh/blob - test/mhshow/test-subpart
2 ######################################################
4 # Test show of one part, fixed by
5 # 31cba404636730df219dd009ca5893ccc56d46af
7 ######################################################
11 if test -z "${MH_OBJ_DIR}"; then
12 srcdir
=`dirname "$0"`/..
/..
13 MH_OBJ_DIR
=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
16 .
"$MH_OBJ_DIR/test/common.sh"
20 expected
=$MH_TEST_DIR/$$.expected
21 actual
=$MH_TEST_DIR/$$.actual
23 # Write message with a text/plain subpart.
25 msgnum
=`basename $msgfile`
28 Content-Type: multipart/mixed; boundary="NextPart_001"
29 Content-class: urn:content-classes:message
30 Date: Thu, 19 May 2011 00:00:00 -0000
31 From: sender@example.com
32 To: recipient@example.com
34 This is a multi-part message in MIME format.
37 Content-Type: multipart/related;
38 type="multipart/alternative";
39 boundary="NextPart_002"
42 Content-Type: text/plain;
45 This is the text/plain part.
52 # Write the expected output.
55 [ part 1.1 - text/plain - 29B ]
56 This is the text/plain part.
60 run_prog mhshow
-part 1.1 -form mhl.null
$msgnum > $actual 2>&1
61 check
"$expected" "$actual" : part
1.1
64 # tests of -part/-type/-prefer
67 To: example@example.org
68 From: someone <someone@example.com>
69 Subject: mhshow -part/-type/-prefer test
70 Date: Thu, 29 Jan 2015 18:12:21 +0000 (GMT)
71 Content-Type: multipart/mixed; boundary="BoundaryMixed"
74 Content-type: multipart/alternative;
75 boundary="BoundaryAlternative1"
77 --BoundaryAlternative1
78 Content-type: text/plain; charset=ISO-8859-1; format=flowed
79 Content-transfer-encoding: 8bit
81 This is the body text/plain part.
82 --BoundaryAlternative1
83 Content-type: multipart/related;
84 boundary="BoundaryAlternative2"; type="text/html"
86 --BoundaryAlternative2
87 Content-type: text/html; CHARSET=US-ASCII
88 Content-transfer-encoding: quoted-printable
90 <html><body><div><span style=3D"line-height: 1.5;">
91 This is the text/html body part.
92 </span></div></body></html>
94 --BoundaryAlternative2--
96 --BoundaryAlternative1--
99 Content-Type: text/plain; charset="us-ascii"
101 Content-Transfer-Encoding: 7bit
102 Content-Disposition: inline
104 _______________________________________________
105 This is the final text/plain signature part.
110 # Write the expected output.
111 cat > $expected <<EOF
113 [ part 1.1.1 - text/html - 111B ]
114 This is the text/html body part.
118 run_prog mhshow
-part 1.1.1 -form mhl.null
$msgnum > $actual 2>&1
119 check
"$expected" "$actual" : part
1.1.1
121 # Write the expected output.
122 cat > $expected <<EOF
124 [ part 1.2 - text/plain - 33B ]
125 This is the body text/plain part.
129 run_prog mhshow
-part 1.2 -form mhl.null
$msgnum > $actual 2>&1
130 check
"$expected" "$actual" : part
1.2
132 # Write the expected output.
133 cat > $expected <<EOF
135 [ part 1.1 - text/plain - 33B ]
136 This is the body text/plain part.
140 run_prog mhshow
-prefer text
/plain
-part 1 -form mhl.null
$msgnum > $actual 2>&1
141 check
"$expected" "$actual" : part conflicting text
/plain
, part
1 switches
143 # Write the expected output.
144 cat > $expected <<EOF
146 [ part 2 - text/plain - 93B ]
147 _______________________________________________
148 This is the final text/plain signature part.
152 run_prog mhshow
-part 2 -form mhl.null
$msgnum > $actual 2>&1
153 check
"$expected" "$actual" : part
2
155 # Write the expected output.
156 cat > $expected <<EOF
158 [ part 1.2 - text/plain - 33B ]
159 This is the body text/plain part.
160 [ part 2 - text/plain - 93B ]
161 _______________________________________________
162 This is the final text/plain signature part.
166 run_prog mhshow
-type text
/plain
-form mhl.null
$msgnum > $actual 2>&1
167 check
"$expected" "$actual" : type text
/plain
169 # Write the expected output.
170 cat > $expected <<EOF
172 [ part 1.1 - text/plain - 33B ]
173 This is the body text/plain part.
174 [ part 2 - text/plain - 93B ]
175 _______________________________________________
176 This is the final text/plain signature part.
179 run_prog mhshow
-prefer text
/plain
-form mhl.null
$msgnum > $actual 2>&1
180 check
"$expected" "$actual" : prefer text
/plain