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