]>
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 expected
=$MH_TEST_DIR/$$.expected
23 actual
=$MH_TEST_DIR/Mail
/draft
28 Usage: repl: [+folder] [msg] [switches]
58 run_prog repl
-help >$actual 2>&1
59 check
$expected $actual
64 * ) printf '%s: repl -v generated unexpected output\n' "$0" >&2
65 failed
=`expr ${failed:-0} + 1`;;
68 # check unknown switch
69 run_test
"repl -nonexistent" 'repl: -nonexistent unknown'
71 # check with no switches
72 run_test
"repl" 'repl: no cur message'
75 printf 'Local-Mailbox: mymailbox@localhost\n' >> "$MH"
79 From: mymailbox@localhost
80 To: Test1 <test1@example.com>
81 cc: mymailbox@localhost
83 Subject: Re: Testing message 1
84 In-reply-to: 1@test.nmh
85 References: 1@test.nmh
86 Comments: In-reply-to Test1 <test1@example.com>
87 message dated "Fri, 29 Sep 2006 00:00:00."
91 run_prog repl
-cc me
-editor true
-nowhatnowproc 1
92 check
$expected $actual
96 From: mymailbox@localhost
97 To: Test1 <test1@example.com>
100 Subject: Re: Testing message 1
101 In-reply-to: 1@test.nmh
102 References: 1@test.nmh
103 Comments: In-reply-to Test1 <test1@example.com>
104 message dated "Fri, 29 Sep 2006 00:00:00."
108 run_prog repl
-cc me
-nocc me
-editor true
-nowhatnowproc 1
109 check
$expected $actual
111 # check -cc me with Local- and Alternate-Mailbox addtions, Bug #36635:
112 # -nocc me doesn't account for Alternate-Mailboxes.
113 printf 'Alternate-Mailboxes: user@example.com\n' >> "$MH"
116 From: mymailbox@localhost
117 To: Test1 <test1@example.com>
118 cc: mymailbox@localhost
120 Subject: Re: Testing message 1
121 In-reply-to: 1@test.nmh
122 References: 1@test.nmh
123 Comments: In-reply-to Test1 <test1@example.com>
124 message dated "Fri, 29 Sep 2006 00:00:00."
128 run_prog repl
-cc me
-editor true
-nowhatnowproc 1
129 check
$expected $actual
132 # check -nocc me with Local- and Alternate-Mailbox addtions, Bug #36635:
133 # -nocc me doesn't account for Alternate-Mailboxes.
135 From: mymailbox@localhost
136 To: Test1 <test1@example.com>
139 Subject: Re: Testing message 1
140 In-reply-to: 1@test.nmh
141 References: 1@test.nmh
142 Comments: In-reply-to Test1 <test1@example.com>
143 message dated "Fri, 29 Sep 2006 00:00:00."
147 run_prog repl
-cc me
-nocc me
-editor true
-nowhatnowproc 1
148 check
$expected $actual
151 # check quoting of local part of invalid address, Bug #26780
152 cat >`mhpath new` <<EOF
153 From: Test11 <test11@example.com>
154 To: before_auser@example.com, A. User <auser@example.com>,
155 after_user@example.com
156 Date: Fri, 29 Sep 2006 00:00:11
157 Message-Id: 11@test.nmh
158 Subject: Testing message 11
160 This is message number 11
165 From: mymailbox@localhost
166 To: Test11 <test11@example.com>
167 cc: before_auser@example.com, "A. User" <auser@example.com>,
168 after_user@example.com
170 Subject: Re: Testing message 11
171 In-reply-to: 11@test.nmh
172 References: 11@test.nmh
173 Comments: In-reply-to Test11 <test11@example.com>
174 message dated "Fri, 29 Sep 2006 00:00:11."
178 run_prog repl
-cc to
-editor true
-nowhatnowproc 11
179 check
$expected $actual