]>
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
- # gcov
24 expected
=$MH_TEST_DIR/$$.expected
25 actual
=$MH_TEST_DIR/Mail
/draft
30 Usage: repl: [+folder] [msg] [switches]
40 -convertargs type argstring
60 #### Skip nmh intro text.
61 run_prog repl
-help | sed '/^$/,$d' >"$actual" 2>&1
62 check
"$expected" "$actual"
67 * ) printf '%s: repl -v generated unexpected output\n' "$0" >&2
68 failed
=`expr ${failed:-0} + 1`;;
71 # check unknown switch
72 run_test
"repl -nonexistent" 'repl: -nonexistent unknown'
74 # check with no switches
75 run_test
"repl" 'repl: no cur message'
78 printf 'Local-Mailbox: mymailbox@localhost\n' >> "$MH"
82 From: mymailbox@localhost
83 To: Test1 <test1@example.com>
84 cc: mymailbox@localhost
86 Subject: Re: Testing message 1
87 In-reply-to: 1@test.nmh
88 References: 1@test.nmh
89 Comments: In-reply-to Test1 <test1@example.com>
90 message dated "Fri, 29 Sep 2006 00:00:00."
94 run_prog repl
-cc me
-editor true
-nowhatnowproc 1
95 check
$expected $actual
99 From: mymailbox@localhost
100 To: Test1 <test1@example.com>
103 Subject: Re: Testing message 1
104 In-reply-to: 1@test.nmh
105 References: 1@test.nmh
106 Comments: In-reply-to Test1 <test1@example.com>
107 message dated "Fri, 29 Sep 2006 00:00:00."
111 run_prog repl
-cc me
-nocc me
-editor true
-nowhatnowproc 1
112 check
$expected $actual
114 # check -cc me with Local- and Alternate-Mailbox addtions, Bug #36635:
115 # -nocc me doesn't account for Alternate-Mailboxes.
116 printf 'Alternate-Mailboxes: user@example.com\n' >> "$MH"
119 From: mymailbox@localhost
120 To: Test1 <test1@example.com>
121 cc: mymailbox@localhost
123 Subject: Re: Testing message 1
124 In-reply-to: 1@test.nmh
125 References: 1@test.nmh
126 Comments: In-reply-to Test1 <test1@example.com>
127 message dated "Fri, 29 Sep 2006 00:00:00."
131 run_prog repl
-cc me
-editor true
-nowhatnowproc 1
132 check
$expected $actual
135 # check -nocc me with Local- and Alternate-Mailbox addtions, Bug #36635:
136 # -nocc me doesn't account for Alternate-Mailboxes.
138 From: mymailbox@localhost
139 To: Test1 <test1@example.com>
142 Subject: Re: Testing message 1
143 In-reply-to: 1@test.nmh
144 References: 1@test.nmh
145 Comments: In-reply-to Test1 <test1@example.com>
146 message dated "Fri, 29 Sep 2006 00:00:00."
150 run_prog repl
-cc me
-nocc me
-editor true
-nowhatnowproc 1
151 check
$expected $actual
154 # check quoting of local part of invalid address, Bug #26780
155 cat >`mhpath new` <<EOF
156 From: Test11 <test11@example.com>
157 To: before_auser@example.com, A. User <auser@example.com>,
158 after_user@example.com
159 Date: Fri, 29 Sep 2006 00:00:11
160 Message-Id: 11@test.nmh
161 Subject: Testing message 11
163 This is message number 11
168 From: mymailbox@localhost
169 To: Test11 <test11@example.com>
170 cc: before_auser@example.com, "A. User" <auser@example.com>,
171 after_user@example.com
173 Subject: Re: Testing message 11
174 In-reply-to: 11@test.nmh
175 References: 11@test.nmh
176 Comments: In-reply-to Test11 <test11@example.com>
177 message dated "Fri, 29 Sep 2006 00:00:11."
181 run_prog repl
-cc to
-editor true
-nowhatnowproc 11
182 check
$expected $actual