]> diplodocus.org Git - nmh/blob - test/mhshow/test-charset
modify tests for the new mhshow mime part marker format
[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 LC_ALL=en_US.UTF-8; export LC_ALL
20
21 expected=$MH_TEST_DIR/$$.expected
22 actual=$MH_TEST_DIR/$$.actual
23
24 echo 'mhshow-charset-windows-1252: echo "This is a test"' >> "$MH"
25
26 # Write message with bogus quoted-printable data.
27 msgfile=`mhpath new`
28 msgnum=`basename $msgfile`
29 cat > $msgfile <<EOF
30 From: foo@example.edu
31 To: bar@example.edu
32 Subject: test
33 MIME-Version: 1.0
34 Content-Type: text/plain; charset=windows-1252
35 Content-Transfer-Encoding: quoted-printable
36 Content-Description: bogus quoted-printable data
37 Date: Sun, 18 Dec 2005 00:52:39 +0100
38
39 4 =F7 2 =3D 2
40 EOF
41
42 cat > $expected <<EOF
43 Date: Sun, 18 Dec 2005 00:52:39 +0100
44 To: bar@example.edu
45 From: foo@example.edu
46 Subject: test
47
48 MIME-Version: 1.0
49 Content-Description: bogus quoted-printable data
50
51 [ part - text/plain - bogus quoted-printable data 11B ]
52 This is a test
53 EOF
54
55 run_prog mhshow $msgnum > $actual 2>&1
56 check "$expected" "$actual"
57
58 exit $failed