Still more autoconf cleanup (quoting & more use of M4sh).
[mmh] / test / tests / mhshow / test-qp
1 #!/bin/sh
2 ######################################################
3 #
4 # Test quoted-printable decoding.
5 #
6 ######################################################
7
8 set -e
9
10 expected=$MH_TEST_DIR/$$.expected
11 actual=$MH_TEST_DIR/$$.actual
12
13 # Write message with bogus quoted-printable data.
14 msgfile=$(mhpath new)
15 msgnum=$(basename $msgfile)
16 cat > $msgfile <<EOF
17 From: foo@example.edu
18 To: bar@example.edu
19 Subject: test
20 MIME-Version: 1.0
21 Content-Transfer-Encoding: quoted-printable
22 Date: Sun, 18 Dec 2005 00:52:39 +0100
23
24 =3D
25 =3d
26 ignored space at end 
27 ignored tab at end      
28 just a newline =
29
30 ==3d ====3D
31 =       just a tab
32 = just a space
33 =cl
34 =l with a space
35 =l
36 =\b ^H (backspace) character, probably erased = in diff output
37 EOF
38
39 # check it
40 cat > $expected <<EOF
41 Date:    Sun, 18 Dec 2005 00:52:39 +0100
42 To:      bar@example.edu
43 From:    foo@example.edu
44 Subject: test
45
46 MIME-Version: 1.0
47
48 part       text/plain                 181
49 =
50 =
51 ignored space at end
52 ignored tab at end
53 just a newline 
54 == ====
55 =       just a tab
56 = just a space
57 =cl
58 =l with a space
59 =l
60 =\b ^H (backspace) character, probably erased = in diff output
61 EOF
62 mhshow -nopause $msgnum > $actual 2>&1
63 diff -u $expected $actual