]> diplodocus.org Git - nmh/blob - test/mhl/test-mhl-flags
36a73236556b7e944a335891847beac9aac3e1f2
[nmh] / test / mhl / test-mhl-flags
1 #!/bin/sh
2 #
3 # Test of various (well, start with one) function escapes.
4
5 set -e
6
7 if test -z "${MH_OBJ_DIR}"; then
8 srcdir=`dirname "$0"`/../..
9 MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
10 fi
11
12 . "$MH_OBJ_DIR/test/common.sh"
13
14 setup_test
15 mhl="${MH_LIB_DIR}/mhl"
16 expected="$MH_TEST_DIR/$$.expected"
17 actual="$MH_TEST_DIR/$$.actual"
18
19 cat >`mhpath new` <<EOF
20 MIME-Version: 1.0
21 From: sender@example.com
22 To: recipient@example.com
23 Subject: message with blank lines
24 Date: Mon, 29 Apr 2013 11:51:45 -0400
25
26 There are two blank lines below. And there is a trailing space:
27 And another trailing space:
28
29
30 EOF
31
32
33 # check that blank lines don't end with whitepace
34 cat >"$expected" <<EOF
35 > There are two blank lines below. And there is a trailing space:
36 > And another trailing space:
37 >
38 >
39 EOF
40
41 cat >"$MH_TEST_DIR/test.format" <<EOF
42 body:component="> ",overflowtext=,overflowoffset=0
43 EOF
44
45 "$mhl" -nomoreproc -form "$MH_TEST_DIR/test.format" `mhpath last` >"$actual"
46 check "$expected" "$actual"
47
48
49 rm -f "$MH_TEST_DIR/test.format"
50 exit $failed