]> diplodocus.org Git - nmh/blob - test/mhshow/test-qp
Editing of man/mhparam.man.
[nmh] / test / mhshow / test-qp
1 #!/bin/sh
2 ######################################################
3 #
4 # Test quoted-printable decoding.
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 expected=$MH_TEST_DIR/$$.expected
20 actual=$MH_TEST_DIR/$$.actual
21
22 # Write message with bogus quoted-printable data.
23 msgfile=`mhpath new`
24 msgnum=`basename $msgfile`
25 cat > $msgfile <<EOF
26 From: foo@example.edu
27 To: bar@example.edu
28 Subject: test
29 MIME-Version: 1.0
30 Content-Transfer-Encoding: quoted-printable
31 Date: Sun, 18 Dec 2005 00:52:39 +0100
32
33 =3D
34 =3d
35 ignored space at end
36 ignored tab at end
37 just a newline =
38
39 ==3d ====3D
40 = just a tab
41 = just a space
42 =cl
43 =l with a space
44 =l
45 =\b ^H (backspace) character, probably erased = in diff output
46 EOF
47
48 # check it
49 cat > $expected <<EOF
50 [ Message inbox:11 ]
51 Date: Sun, 18 Dec 2005 00:52:39 +0100
52 To: bar@example.edu
53 From: foo@example.edu
54 Subject: test
55
56 MIME-Version: 1.0
57
58 [ part - text/plain - 181B ]
59 =
60 =
61 ignored space at end
62 ignored tab at end
63 just a newline
64 == ====
65 = just a tab
66 = just a space
67 =cl
68 =l with a space
69 =l
70 =\b ^H (backspace) character, probably erased = in diff output
71 EOF
72 run_prog mhshow $msgnum > $actual 2>&1
73 check "$expected" "$actual" : bogus quoted-printable data
74
75 exit $failed