]> diplodocus.org Git - nmh/blob - test/mhshow/test-textcharset
Removed the -[no]textcharset switches that were added to mhshow(1)
[nmh] / test / mhshow / test-textcharset
1 #!/bin/sh
2 ##########################################################
3 #
4 # Test display of text/plain parts with charset conversion
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 if test "$ICONV_ENABLED" -eq 0; then
20 test_skip 'test-textcharset requires that nmh have been built with iconv'
21 fi
22
23 LC_ALL=en_US.UTF-8; export LC_ALL
24
25 expected="$MH_TEST_DIR"/$$.expected
26 actual="$MH_TEST_DIR"/$$.actual
27
28 msgfile=`mhpath new`
29 cat >"$msgfile" <<EOF
30 From: foo@example.edu
31 To: bar@example.edu
32 Subject: test display with charset conversion
33 MIME-Version: 1.0
34 Content-Type: text/plain; charset=windows-1252
35 Content-Transfer-Encoding: quoted-printable
36 Date: Sun, 18 Dec 2005 00:52:39 +0100
37
38 4 =F7 2 =3D 2
39 EOF
40
41 cat >"$expected" <<EOF
42 Date: Sun, 18 Dec 2005 00:52:39 +0100
43 To: bar@example.edu
44 From: foo@example.edu
45 Subject: test display with charset conversion
46
47 MIME-Version: 1.0
48
49 part text/plain 10
50 4 รท 2 = 2
51 EOF
52
53 run_prog mhshow -nopause last >"$actual" 2>&1
54 check "$expected" "$actual"
55
56 exit $failed