]> diplodocus.org Git - nmh/blob - test/mhshow/test-charset
Moved readconfig() of mhn.defaults into construct_build_directive().
[nmh] / test / mhshow / test-charset
1 #!/bin/sh
2 ######################################################
3 #
4 # Test charset conversion functionality
5 #
6 ######################################################
7
8 set -e
9
10 if test -z "${MH_OBJ_DIR}"; then
11 srcdir=`dirname "$0"`/../..
12 MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
13 fi
14
15 . "$MH_OBJ_DIR/test/common.sh"
16
17 setup_test
18
19 expected=$MH_TEST_DIR/$$.expected
20 actual=$MH_TEST_DIR/$$.actual
21
22 echo 'mhshow-charset-windows-1252: echo "This is a test"' >> $MH_TEST_DIR/Mail/.mh_profile
23
24 # Write message with bogus quoted-printable data.
25 msgfile=`mhpath new`
26 msgnum=`basename $msgfile`
27 cat > $msgfile <<EOF
28 From: foo@example.edu
29 To: bar@example.edu
30 Subject: test
31 MIME-Version: 1.0
32 Content-Type: text/plain; charset=windows-1252
33 Content-Transfer-Encoding: quoted-printable
34 Date: Sun, 18 Dec 2005 00:52:39 +0100
35
36 4 =F7 2 =3D 2
37 EOF
38
39 cat > $expected <<EOF
40 Date: Sun, 18 Dec 2005 00:52:39 +0100
41 To: bar@example.edu
42 From: foo@example.edu
43 Subject: test
44
45 MIME-Version: 1.0
46
47 part text/plain 10
48 This is a test
49 EOF
50
51 run_prog mhshow -nopause $msgnum > $actual 2>&1
52 check "$expected" "$actual"
53
54 exit $failed