]>
diplodocus.org Git - nmh/blob - test/burst/test-burst
3 # Tests to see if bursting messages works correctly.
6 if test -z "${MH_OBJ_DIR}"; then
7 srcdir
=`dirname "$0"`/..
/..
8 MH_OBJ_DIR
=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
11 .
"${MH_OBJ_DIR}/test/common.sh"
15 check_exit
'-eq 1' burst
-
16 check_exit
'-eq 0' burst
-help
17 check_exit
'-eq 1' burst
-xyzzy
18 check_exit
'-eq 0' burst
-version
19 check_exit
'-eq 1' burst
-inplace -noinplace
20 check_exit
'-eq 1' burst
-mime -automime -nomime
21 check_exit
'-eq 1' burst
-quiet -noquiet
22 check_exit
'-eq 1' burst
-verbose -noverbose
23 check_exit
'-eq 1' burst
+ @
26 # Create a test message that we can burst
29 cat > "${MH_TEST_DIR}/Mail/inbox/11" <<EOF
30 From: Test Burst Message <burst1@example.com>
31 To: Test Recipient <recipient@example.com>
32 Date: Friday, 29 Sep 2006 00:00:00
37 From: Mister Burster <burst2@example.com>
38 To: Nobody 1 <nobody1@example.com>
39 Date: Thursday, 28 Sep 2006 00:01:00
46 From: Mister Burster <burst3@example.com>
47 To: Nobody 2 <nobody2@example.com>
48 Date: Thursday, 28 Sep 2006 00:02:00
59 run_prog burst
11 || exit
61 run_test
'scan -width 80 11-last' "\
62 11 09/29 Test Burst Messag Test digest<<------- Message one From: Mister Bur
63 12+ 09/28 Mister Burster Message one<<This is message one >>
64 13 09/28 Mister Burster Message two<<This is message two For real. >>"
67 # Create another test message that stresses the boundary checker a bit
70 cat > "${MH_TEST_DIR}/Mail/inbox/14" <<EOF
71 From: Test Burst Message <burst1@example.com>
72 To: Test Recipient <recipient@example.com>
73 Date: Friday, 29 Sep 2006 00:00:00
79 From: Mister Burster <burst2@example.com>
80 To: Nobody 1 <nobody1@example.com>
81 Date: Thursday, 28 Sep 2006 00:01:00
84 - -This is message one
87 From: Mister Burster <burst3@example.com>
88 To: Nobody 2 <nobody2@example.com>
89 Date: Thursday, 28 Sep 2006 00:02:00
98 From: Mister Burster <burst4@example.com>
99 To: Nobody 3 <nobody3@example.com>
100 Date: Thursday, 28 Sep 2006 00:03:00
101 Subject: Message three
110 run_prog burst
14 || exit
112 run_test
'scan -width 80 14-last' "\
113 14 09/29 Test Burst Messag Test digest<<This is a preamble ------- Message o
114 15+ 09/28 Mister Burster Message one<<-This is message one >>
115 16 09/28 Mister Burster Message two<<This is message two For real. >>
116 17 09/28 Mister Burster Message three<<Will this one work? >>"
119 # Check to see if each message is what we expect
122 run_test
'show -noheader -noshow 15' \
123 "From: Mister Burster <burst2@example.com>
124 To: Nobody 1 <nobody1@example.com>
125 Date: Thursday, 28 Sep 2006 00:01:00
128 -This is message one"
130 run_test
'show -noheader -noshow 16' \
131 "From: Mister Burster <burst3@example.com>
132 To: Nobody 2 <nobody2@example.com>
133 Date: Thursday, 28 Sep 2006 00:02:00
140 # Backticks used by run_test can consume blank lines at the end of the
141 # command output, so use check for this one.
144 expected
="${MH_TEST_DIR}/$$.expected"
145 cat > "${expected}" <<EOF
146 From: Mister Burster <burst4@example.com>
147 To: Nobody 3 <nobody3@example.com>
148 Date: Thursday, 28 Sep 2006 00:03:00
149 Subject: Message three
155 check
"${expected}" `mhpath 17`