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"
16 # Create a test message that we can burst
19 cat > "${MH_TEST_DIR}/Mail/inbox/11" <<EOF
20 From: Test Burst Message <burst1@example.com>
21 To: Test Recipient <recipient@example.com>
22 Date: Friday, 29 Sep 2006 00:00:00
27 From: Mister Burster <burst2@example.com>
28 To: Nobody 1 <nobody1@example.com>
29 Date: Thursday, 28 Sep 2006 00:01:00
36 From: Mister Burster <burst3@example.com>
37 To: Nobody 2 <nobody2@example.com>
38 Date: Thursday, 28 Sep 2006 00:02:00
51 run_test 'scan -width 80 11-last' \
52 " 11 09/29 Test Burst Messag Test digest<<------- Message one From: Mister Bu
53 12+ 09/28 Mister Burster Message one<<This is message one >>
54 13 09/28 Mister Burster Message two<<This is message two For real. >>"
57 # Create another test message that stresses the boundary checker a bit
60 cat > "${MH_TEST_DIR}/Mail/inbox/14" <<EOF
61 From: Test Burst Message <burst1@example.com>
62 To: Test Recipient <recipient@example.com>
63 Date: Friday, 29 Sep 2006 00:00:00
69 From: Mister Burster <burst2@example.com>
70 To: Nobody 1 <nobody1@example.com>
71 Date: Thursday, 28 Sep 2006 00:01:00
74 - -This is message one
77 From: Mister Burster <burst3@example.com>
78 To: Nobody 2 <nobody2@example.com>
79 Date: Thursday, 28 Sep 2006 00:02:00
88 From: Mister Burster <burst4@example.com>
89 To: Nobody 3 <nobody3@example.com>
90 Date: Thursday, 28 Sep 2006 00:03:00
91 Subject: Message three
102 run_test 'scan -width 80 14-last' \
103 " 14 09/29 Test Burst Messag Test digest<<This is a preamble ------- Message
104 15+ 09/28 Mister Burster Message one<<-This is message one >>
105 16 09/28 Mister Burster Message two<<This is message two For real. >>
106 17 09/28 Mister Burster Message three<<Will this one work? >>"
109 # Check to see if each message is what we expect
112 run_test 'show -noheader -noshow 15' \
113 "From: Mister Burster <burst2@example.com>
114 To: Nobody 1 <nobody1@example.com>
115 Date: Thursday, 28 Sep 2006 00:01:00
118 -This is message one"
120 run_test 'show -noheader -noshow 16' \
121 "From: Mister Burster <burst3@example.com>
122 To: Nobody 2 <nobody2@example.com>
123 Date: Thursday, 28 Sep 2006 00:02:00
130 # Backticks used by run_test can consume blank lines at the end of the
131 # command output, so use check for this one.
134 expected="${MH_TEST_DIR}/$$.expected"
135 cat > "${expected}" <<EOF
136 From: Mister Burster <burst4@example.com>
137 To: Nobody 3 <nobody3@example.com>
138 Date: Thursday, 28 Sep 2006 00:03:00
139 Subject: Message three
145 check "${expected}" `mhpath 17`