Fix typo in alternate mts.conf location support.
[mmh] / test / 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 if [ -z "${MH_TEST_COMMON}" ]; then
12     echo "MH_TEST_COMMON not set; try running via 'make check'"
13 fi
14
15 . ${MH_TEST_COMMON}
16
17 setup_test
18
19 expected=$MH_TEST_DIR/$$.expected
20 actual=$MH_TEST_DIR/$$.actual
21
22 # Write message with a text/plain subpart.
23 msgfile=$(mhpath new)
24 msgnum=$(basename $msgfile)
25 cat > $msgfile <<EOF
26 MIME-Version: 1.0
27 Content-Type: multipart/mixed; boundary="NextPart_001"
28 Content-class: urn:content-classes:message
29 Date: Thu, 19 May 2011 00:00:00 -0000
30 From: sender@example.com
31 To: recipient@example.com
32
33 This is a multi-part message in MIME format.
34
35 --NextPart_001
36 Content-Type: multipart/related;
37     type="multipart/alternative";
38     boundary="NextPart_002"
39
40 --NextPart_002
41 Content-Type: text/plain;
42     charset="utf-8"
43
44 This is the text/plain part.
45
46 --NextPart_002--
47
48 --NextPart_001--
49 EOF
50
51 # Write the expected output.
52 cat > $expected <<EOF
53 part 1.1   text/plain                  29
54 This is the text/plain part.
55 EOF
56
57 # check it
58 mhshow -part 1.1 -form mhl.null -nopause $msgnum > $actual 2>&1
59 diff -u $expected $actual  &&  rm -f $expected $actual