]> diplodocus.org Git - nmh/blob - test/mhbuild/test-ext-params
First basic test of extended parameter output: working!
[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 Fcc: +outbox
30 ------
31 This is a test message
32 #image/jpeg {attachment; filename="tïny.jpg"} ${srcdir}/test/mhbuild/tiny.jpg
33 EOF
34
35 run_prog mhbuild "$draft"
36
37 cat > "$expected" <<EOF
38 To: Mr Test <mrtest@example.com>
39 cc:
40 Fcc: +outbox
41 MIME-Version: 1.0
42 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
43
44 ------- =_aaaaaaaaaa0
45 Content-Type: text/plain; charset="us-ascii"
46
47 This is a test message
48
49 ------- =_aaaaaaaaaa0
50 Content-Type: image/jpeg
51 Content-Disposition: attachment; filename*=UTF-8''t%C3%AFny.jpg
52 Content-Transfer-Encoding: base64
53
54 /9g=
55
56 ------- =_aaaaaaaaaa0--
57 EOF
58
59 check "$draft" "$expected"
60
61 exit ${failed:-0}