]>
diplodocus.org Git - nmh/blob - test/repl/test-repl
2 ######################################################
6 ######################################################
8 # This is not a comprehensive test of repl, but some day it will be :-)
13 if test -z "${MH_OBJ_DIR}"; then
14 srcdir
=`dirname $0`/..
/..
15 MH_OBJ_DIR
=`cd $srcdir && pwd`; export MH_OBJ_DIR
18 .
"$MH_OBJ_DIR/test/common.sh"
22 check_exit
'-eq 1' repl
-
24 expected
=$MH_TEST_DIR/$$.expected
25 actual
=$MH_TEST_DIR/Mail
/draft
31 Usage: repl: [+folder] [msg] [switches]
41 -convertargs type argstring
61 #### Skip nmh intro text.
62 run_prog repl
-help | sed '/^$/,$d' >"$actual" 2>&1
63 check
"$expected" "$actual"
69 * ) printf '%s: repl -v generated unexpected output\n' "$0" >&2
70 failed
=`expr ${failed:-0} + 1`;;
73 # check unknown switch
74 start_test
'unknown switch'
75 run_test
"repl -nonexistent" 'repl: -nonexistent unknown'
77 # check with no switches
78 start_test
'with no switches'
79 run_test
"repl" 'repl: no cur message'
82 printf 'Local-Mailbox: mymailbox@localhost\n' >> "$MH"
87 From: mymailbox@localhost
88 To: Test1 <test1@example.com>
89 cc: mymailbox@localhost
91 Subject: Re: Testing message 1
92 In-reply-to: 1@test.nmh
93 References: 1@test.nmh
94 Comments: In-reply-to Test1 <test1@example.com>
95 message dated "Fri, 29 Sep 2006 00:00:00."
99 run_prog repl
-cc me
-editor true
-nowhatnowproc 1
100 check
$expected $actual
103 start_test
'-nocc me'
105 From: mymailbox@localhost
106 To: Test1 <test1@example.com>
109 Subject: Re: Testing message 1
110 In-reply-to: 1@test.nmh
111 References: 1@test.nmh
112 Comments: In-reply-to Test1 <test1@example.com>
113 message dated "Fri, 29 Sep 2006 00:00:00."
117 run_prog repl
-cc me
-nocc me
-editor true
-nowhatnowproc 1
118 check
$expected $actual
120 # check -cc me with Local- and Alternate-Mailbox addtions, Bug #36635
121 start_test
'-cc me with Local- and Alternate-Mailbox addtions, Bug #36635'
122 # -nocc me doesn't account for Alternate-Mailboxes.
123 printf 'Alternate-Mailboxes: user@example.com\n' >> "$MH"
126 From: mymailbox@localhost
127 To: Test1 <test1@example.com>
128 cc: mymailbox@localhost
130 Subject: Re: Testing message 1
131 In-reply-to: 1@test.nmh
132 References: 1@test.nmh
133 Comments: In-reply-to Test1 <test1@example.com>
134 message dated "Fri, 29 Sep 2006 00:00:00."
138 run_prog repl
-cc me
-editor true
-nowhatnowproc 1
139 check
$expected $actual
142 # check -nocc me with Local- and Alternate-Mailbox addtions, Bug #36635
143 start_test
'-nocc me with Local- and Alternate-Mailbox addtions, Bug #36635'
144 # -nocc me doesn't account for Alternate-Mailboxes.
146 From: mymailbox@localhost
147 To: Test1 <test1@example.com>
150 Subject: Re: Testing message 1
151 In-reply-to: 1@test.nmh
152 References: 1@test.nmh
153 Comments: In-reply-to Test1 <test1@example.com>
154 message dated "Fri, 29 Sep 2006 00:00:00."
158 run_prog repl
-cc me
-nocc me
-editor true
-nowhatnowproc 1
159 check
$expected $actual
162 # check quoting of local part of invalid address, Bug #26780
163 start_test
'quoting of local part of invalid address, Bug #26780'
164 cat >`mhpath new` <<EOF
165 From: Test11 <test11@example.com>
166 To: before_auser@example.com, A. User <auser@example.com>,
167 after_user@example.com
168 Date: Fri, 29 Sep 2006 00:00:11
169 Message-Id: 11@test.nmh
170 Subject: Testing message 11
172 This is message number 11
177 From: mymailbox@localhost
178 To: Test11 <test11@example.com>
179 cc: before_auser@example.com, "A. User" <auser@example.com>,
180 after_user@example.com
182 Subject: Re: Testing message 11
183 In-reply-to: 11@test.nmh
184 References: 11@test.nmh
185 Comments: In-reply-to Test11 <test11@example.com>
186 message dated "Fri, 29 Sep 2006 00:00:11."
190 run_prog repl
-cc to
-editor true
-nowhatnowproc 11
191 check
$expected $actual
194 # check that Fcc: header isn't propagated
195 start_test
"Fcc: header isn't propagated"
196 form
="${MH_TEST_DIR}/$$.components"
198 From: sender@example.com
199 %<{from}%(void(width))%(putaddr To: )%>
201 Subject: %<{subject}Re: %(void{subject})%(trim)%(putstr)%>
204 cat > $expected <<EOF
205 From: sender@example.com
206 To: recipient@example.com
208 Subject: Re: suppress Fcc:
211 cat > `mhpath new`<<EOF
212 From: recipient@example.com
213 To: sender@example.com
215 Subject: suppress Fcc:
219 run_prog repl
-form "${form}" -nowhatnowproc last
220 check
"${expected}" "${actual}"
223 # check -fcc with Fcc: in replied-to message
224 start_test
'-fcc with Fcc: in replied-to message'
225 form
="${MH_TEST_DIR}/$$.components"
226 cat > $expected <<EOF
227 From: sender@example.com
228 To: recipient@example.com
230 Subject: Re: suppress Fcc:
234 run_prog repl
-fcc +myoutbox
-form "${form}" -nowhatnowproc last
235 check
"${expected}" "${actual}"
237 test "${failed:-0}" -eq 0 && rm "${form}"