Rearranged test suite environment variables so that individual tests
[mmh] / test / mhshow / test-cte-binary
1 #!/bin/sh
2 ######################################################
3 #
4 # Test Content-Transfer-Encoding: binary (Debian #136976).
5 #
6 ######################################################
7
8 if test -z "${MH_OBJ_DIR}"; then
9     srcdir=`dirname $0`/../..
10     MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR
11 fi
12
13 . "$MH_OBJ_DIR/test/common.sh"
14
15 setup_test
16 expected=$MH_TEST_DIR/$$.expected
17 actual=$MH_TEST_DIR/$$.actual
18
19 # Write message with Content-Transfer-Encoding: binary text.
20 msgfile=$(mhpath new)
21 msgnum=$(basename $msgfile)
22 cat > $msgfile <<EOF
23 Content-Transfer-Encoding: binary
24 To: bar@example.edu
25 Content-Type: text/plain
26 Subject: test
27 From: foo@example.edu
28 MIME-Version: 1.0
29 Content-Disposition: inline
30 Message-Id: <20698507875204@example.com>
31 Date: Tue, 05 Mar 2002 18:20:35 +0000
32
33 This is a test; this is the body.
34 EOF
35
36 # check it
37 cat > $expected <<EOF
38 Date:    Tue, 05 Mar 2002 18:20:35 +0000
39 To:      bar@example.edu
40 From:    foo@example.edu
41 Subject: test
42
43 MIME-Version: 1.0
44 Content-Disposition: inline
45
46 part       text/plain                  34
47 This is a test; this is the body.
48 EOF
49 mhshow -nopause $msgnum > $actual 2>&1
50 diff -u $expected $actual