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