]> diplodocus.org Git - nmh/blob - test/mhbuild/test-ext-params
Beginnings of test suite for RFC 2231 support; does not work yet.
[nmh] / test / mhbuild / test-ext-params
1 #!/bin/sh
2 ######################################################
3 #
4 # Test the creation of RFC 2231 encoded parameters
5 #
6 ######################################################
7
8 if test -z "${MH_OBJ_DIR}"; then
9 srcdir=`dirname "$0"`/../..
10 MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
11 fi
12
13 . "$MH_OBJ_DIR/test/common.sh"
14
15 setup_test
16
17 LC_ALL=en_US.UTF-8; export LC_ALL
18
19 draft="$MH_TEST_DIR/$$.draft"
20 expected="$MH_TEST_DIR/$$.expected"
21
22 #
23 # Try out a draft with some 8-bit encoded parameters
24 #
25
26 cat > "$draft" <<EOF
27 To: Mr Test <mrtest@example.com>
28 cc:
29 ------
30 This is a test message
31 #image/jpeg {attachment; filename="tïny.jpg"} ${srcdir}/test/mhbuild/tiny.jpg
32 EOF
33
34 run_prog mhbuild "$draft"
35
36 cat > "$expected" <<EOF
37 To: Mr Test <mrtest@example.com>
38 cc:
39 Fcc: +outbox
40 MIME-Version: 1.0
41 Content-Type: image/jpeg; name="tiny.jpg"
42 Content-Description: tiny.jpg
43 Content-Disposition: attachment; filename="tiny.jpg"
44 Content-Transfer-Encoding: base64
45
46 /9g=
47 EOF
48
49 check "$draft" "$expected"
50
51 exit ${failed:-0}