]>
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]
38 -convertargs type argstring
58 #### Skip nmh intro text.
59 run_prog repl
-help | sed '/^$/Q' >"$actual" 2>&1
60 check
"$expected" "$actual"
65 * ) printf '%s: repl -v generated unexpected output\n' "$0" >&2
66 failed
=`expr ${failed:-0} + 1`;;
69 # check unknown switch
70 run_test
"repl -nonexistent" 'repl: -nonexistent unknown'
72 # check with no switches
73 run_test
"repl" 'repl: no cur message'
76 printf 'Local-Mailbox: mymailbox@localhost\n' >> "$MH"
80 From: mymailbox@localhost
81 To: Test1 <test1@example.com>
82 cc: mymailbox@localhost
84 Subject: Re: Testing message 1
85 In-reply-to: 1@test.nmh
86 References: 1@test.nmh
87 Comments: In-reply-to Test1 <test1@example.com>
88 message dated "Fri, 29 Sep 2006 00:00:00."
92 run_prog repl
-cc me
-editor true
-nowhatnowproc 1
93 check
$expected $actual
97 From: mymailbox@localhost
98 To: Test1 <test1@example.com>
101 Subject: Re: Testing message 1
102 In-reply-to: 1@test.nmh
103 References: 1@test.nmh
104 Comments: In-reply-to Test1 <test1@example.com>
105 message dated "Fri, 29 Sep 2006 00:00:00."
109 run_prog repl
-cc me
-nocc me
-editor true
-nowhatnowproc 1
110 check
$expected $actual
112 # check -cc me with Local- and Alternate-Mailbox addtions, Bug #36635:
113 # -nocc me doesn't account for Alternate-Mailboxes.
114 printf 'Alternate-Mailboxes: user@example.com\n' >> "$MH"
117 From: mymailbox@localhost
118 To: Test1 <test1@example.com>
119 cc: mymailbox@localhost
121 Subject: Re: Testing message 1
122 In-reply-to: 1@test.nmh
123 References: 1@test.nmh
124 Comments: In-reply-to Test1 <test1@example.com>
125 message dated "Fri, 29 Sep 2006 00:00:00."
129 run_prog repl
-cc me
-editor true
-nowhatnowproc 1
130 check
$expected $actual
133 # check -nocc me with Local- and Alternate-Mailbox addtions, Bug #36635:
134 # -nocc me doesn't account for Alternate-Mailboxes.
136 From: mymailbox@localhost
137 To: Test1 <test1@example.com>
140 Subject: Re: Testing message 1
141 In-reply-to: 1@test.nmh
142 References: 1@test.nmh
143 Comments: In-reply-to Test1 <test1@example.com>
144 message dated "Fri, 29 Sep 2006 00:00:00."
148 run_prog repl
-cc me
-nocc me
-editor true
-nowhatnowproc 1
149 check
$expected $actual
152 # check quoting of local part of invalid address, Bug #26780
153 cat >`mhpath new` <<EOF
154 From: Test11 <test11@example.com>
155 To: before_auser@example.com, A. User <auser@example.com>,
156 after_user@example.com
157 Date: Fri, 29 Sep 2006 00:00:11
158 Message-Id: 11@test.nmh
159 Subject: Testing message 11
161 This is message number 11
166 From: mymailbox@localhost
167 To: Test11 <test11@example.com>
168 cc: before_auser@example.com, "A. User" <auser@example.com>,
169 after_user@example.com
171 Subject: Re: Testing message 11
172 In-reply-to: 11@test.nmh
173 References: 11@test.nmh
174 Comments: In-reply-to Test11 <test11@example.com>
175 message dated "Fri, 29 Sep 2006 00:00:11."
179 run_prog repl
-cc to
-editor true
-nowhatnowproc 11
180 check
$expected $actual