Fix typo in alternate mts.conf location support.
[mmh] / test / tests / mhshow / test-subpart
1 #!/bin/sh
2 ######################################################
3 #
4 # Test show of one part, fixed by
5 # 31cba404636730df219dd009ca5893ccc56d46af
6 #
7 ######################################################
8
9 set -e
10
11 expected=$MH_TEST_DIR/$$.expected
12 actual=$MH_TEST_DIR/$$.actual
13
14 # Write message with a text/plain subpart.
15 msgfile=$(mhpath new)
16 msgnum=$(basename $msgfile)
17 cat > $msgfile <<EOF
18 MIME-Version: 1.0
19 Content-Type: multipart/mixed; boundary="NextPart_001"
20 Content-class: urn:content-classes:message
21 Date: Thu, 19 May 2011 00:00:00 -0000
22 From: sender@example.com
23 To: recipient@example.com
24
25 This is a multi-part message in MIME format.
26
27 --NextPart_001
28 Content-Type: multipart/related;
29     type="multipart/alternative";
30     boundary="NextPart_002"
31
32 --NextPart_002
33 Content-Type: text/plain;
34     charset="utf-8"
35
36 This is the text/plain part.
37
38 --NextPart_002--
39
40 --NextPart_001--
41 EOF
42
43 # Write the expected output.
44 cat > $expected <<EOF
45 part 1.1   text/plain                  29
46 This is the text/plain part.
47 EOF
48
49 # check it
50 mhshow -part 1.1 -form mhl.null -nopause $msgnum > $actual 2>&1
51 diff -u $expected $actual  &&  rm -f $expected $actual