]>
diplodocus.org Git - nmh/blob - test/mhbuild/test-mhbuild
2 ######################################################
6 ######################################################
8 if test -z "${MH_OBJ_DIR}"; then
9 srcdir
=`dirname "$0"`/..
/..
10 MH_OBJ_DIR
=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
13 .
"$MH_OBJ_DIR/test/common.sh"
17 expected
="$MH_TEST_DIR/test-mhbuild$$.expected"
19 start_test
"-nodirectives"
20 cat >"$expected" <<'EOF'
21 Subject: test -nodirectives
23 Content-Type: text/plain; charset="us-ascii"
25 #define line begins with # and ends with backslash-newline \
26 all characters should be preserved
29 cat >"`mhpath new`" <<'EOF'
30 Subject: test -nodirectives
32 #define line begins with # and ends with backslash-newline \
33 all characters should be preserved
36 run_test
"mhbuild -nodirectives `mhpath last`"
37 check
"`mhpath last`" "$expected"
39 start_test
"Checking for MIME-Version handling in draft"
41 cat > "`mhpath new`" <<'EOF'
42 From: Somebody <somebody@example.com>
43 To: Nobody <nobody@example.com>
50 cat >"$expected" <<'EOF'
51 From: Somebody <somebody@example.com>
52 To: Nobody <nobody@example.com>
59 run_test
"mhbuild `mhpath last`" "mhbuild: draft shouldn't contain MIME-Version: field"
60 check
"`mhpath last`" "$expected" 'keep first'
62 cat >"$expected" <<'EOF'
63 From: Somebody <somebody@example.com>
64 To: Nobody <nobody@example.com>
71 run_test
"mhbuild -auto `mhpath last`"
72 check
"`mhpath last`" "$expected"
74 start_test
"Checking for arbitrary Content header handling in draft"
76 cat > "`mhpath new`" <<'EOF'
77 From: Somebody <somebody@example.com>
78 To: Nobody <nobody@example.com>
85 cat >"$expected" <<'EOF'
86 From: Somebody <somebody@example.com>
87 To: Nobody <nobody@example.com>
94 run_test
"mhbuild `mhpath last`" "mhbuild: draft shouldn't contain Content-Fart: field"
95 check
"`mhpath last`" "$expected" 'keep first'
97 cat >"$expected" <<'EOF'
98 From: Somebody <somebody@example.com>
99 To: Nobody <nobody@example.com>
100 Subject: Test message
101 Content-Fart: nothing
106 run_test
"mhbuild -auto `mhpath last`" "mhbuild: draft shouldn't contain Content-Fart: field"
107 check
"`mhpath last`" "$expected"
109 start_test
"Checking for out-of-order Content header handling in draft"
111 cat > "`mhpath new`" <<'EOF'
112 From: Somebody <somebody@example.com>
113 To: Nobody <nobody@example.com>
114 Subject: Test message
115 Content-Fart: nothing
121 cat >"$expected" <<'EOF'
122 From: Somebody <somebody@example.com>
123 To: Nobody <nobody@example.com>
124 Subject: Test message
125 Content-Fart: nothing
131 run_test
"mhbuild `mhpath last`" "mhbuild: draft shouldn't contain MIME-Version: field"
132 check
"`mhpath last`" "$expected" 'keep first'
134 cat >"$expected" <<'EOF'
135 From: Somebody <somebody@example.com>
136 To: Nobody <nobody@example.com>
137 Subject: Test message
138 Content-Fart: nothing
144 run_test
"mhbuild -auto `mhpath last`"
145 check
"`mhpath last`" "$expected"