tests: Adjusted most of the tests to mmh.
[mmh] / test / tests / show / 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 b)
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 From:    foo@example.edu
43 To:      bar@example.edu
44 Subject: test
45
46 part       text/plain                 181
47 =
48 =
49 ignored space at end
50 ignored tab at end
51 just a newline 
52 == ====
53 =       just a tab
54 = just a space
55 =cl
56 =l with a space
57 =l
58 =\b ^H (backspace) character, probably erased = in diff output
59 EOF
60 show $msgnum > $actual 2>&1
61 diff -u $expected $actual