]>
diplodocus.org Git - nmh/blob - test/repl/test-convert
2 ######################################################
4 # Test repl -convertarg
6 ######################################################
10 if test -z "${MH_OBJ_DIR}"; then
11 srcdir
=`dirname $0`/..
/..
12 MH_OBJ_DIR
=`cd $srcdir && pwd`; export MH_OBJ_DIR
15 .
"${srcdir}/test/post/test-post-common.sh"
17 expected
="$MH_TEST_DIR/test-convert$$.expected"
18 actual
=`mhpath +`/draft
20 printf 'Local-Mailbox: recipient@example.com' >>"$MH"
23 # check -convertarg with multiple parts and no additional text in draft
24 cat >"$expected" <<'EOF'
25 From: recipient@example.com
26 To: sender@example.com
30 Comments: In-reply-to sender@example.com
31 message dated "Thu, 11 Dec 2014 08:19:02 -0600."
33 Content-Type: text/plain; charset="US-ASCII"
40 cat >`mhpath new` <<'EOF'
41 From: sender@example.com
42 To: recipient@example.com
44 Date: Thu, 11 Dec 2014 08:19:02 -0600
45 Content-Type: multipart/mixed; boundary="_001_"
49 Content-Type: text/plain
54 Content-Type: text/plain
59 Content-Type: text/enriched
61 This should not appear in the reply
62 because the content type isn't matched.
67 repl
-noformat -convertarg text
/plain
'' -nowhatnowproc last
69 check
"$actual" "$expected"
72 #### Make sure that this works with 8-bit encoding.
73 require_locale en_US.utf
-8 en_US.utf8
74 LC_ALL
=en_US.UTF
-8; export LC_ALL
77 # check -convertarg with multiple parts and additional text in draft
78 cat >"$expected" <<'EOF'
79 From: recipient@example.com
80 To: sender@example.com
84 Comments: In-reply-to sender@example.com
85 message dated "Thu, 11 Dec 2014 08:19:02 -0600."
87 Content-Type: text/plain; charset="UTF-8"
88 Content-Transfer-Encoding: 8bit
90 sender@example.com writes:
97 cat >`mhpath new` <<'EOF'
98 From: sender@example.com
99 To: recipient@example.com
101 Date: Thu, 11 Dec 2014 08:19:02 -0600
102 Content-Type: multipart/mixed; boundary="_001_"
106 Content-Type: text/plain
111 Content-Type: text/plain
118 repl
-filter mhl.replywithoutbody
-convertarg text
/plain
'' -nowhatnowproc last
120 check
"$actual" "$expected"