]> diplodocus.org Git - nmh/blob - test/mhl/test-mhl-flags
netsec_set_tls(): Return a value in the !TLS_SUPPORT && !tls case.
[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_LIBEXEC_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 and trailing spaces
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 nortrim (default), and that trailing whitespace in a
34 # component is trimmed when filtering blank lines
35 cat >"$expected" <<EOF
36 > There are two blank lines below. And there is a trailing space:
37 > And another trailing space:
38 >
39 >
40 EOF
41
42 cat >"$MH_TEST_DIR/test.format" <<EOF
43 body:component="> "
44 EOF
45
46 "$mhl" -nomoreproc -form "$MH_TEST_DIR/test.format" `mhpath last` >"$actual"
47 check "$expected" "$actual"
48
49
50 # check rtrim
51 cat >"$expected" <<EOF
52 > There are two blank lines below. And there is a trailing space:
53 > And another trailing space:
54 >
55 >
56 EOF
57
58 cat >"$MH_TEST_DIR/test.format" <<EOF
59 body:component="> ",rtrim
60 EOF
61
62 "$mhl" -nomoreproc -form "$MH_TEST_DIR/test.format" `mhpath last` >"$actual"
63 check "$expected" "$actual"
64
65
66 rm -f "$MH_TEST_DIR/test.format"
67
68 exit $failed