Commit 764ebfd7 764ebfd7f22dd2634413f1d427ab0f51b0b7797b by Sergey Poznyakoff

mh: add repl tests.

* mh/repl.c: Minor changes.
* tests/repl.at: New file.
* tests/Makefile.am (TESTSUITE_AT): Add repl.at
* mh/tests/testsuite.at: Include repl.at.
* mh/TODO: Update.
1 parent 39160956
...@@ -19,7 +19,7 @@ State Nice Utility Comments ...@@ -19,7 +19,7 @@ State Nice Utility Comments
19 ------------------------------------------- 19 -------------------------------------------
20 + -20 scan 20 + -20 scan
21 + -20 inc 21 + -20 inc
22 * -20 repl --inplace 22 * -20 repl --inplace,--query
23 + -20 comp 23 + -20 comp
24 * -20 forw --inplace 24 * -20 forw --inplace
25 * -20 send --alias,--filter,--format,--forward,--mime, 25 * -20 send --alias,--filter,--format,--forward,--mime,
......
...@@ -58,7 +58,7 @@ static struct argp_option options[] = { ...@@ -58,7 +58,7 @@ static struct argp_option options[] = {
58 {"inplace", ARG_INPLACE, N_("BOOL"), OPTION_ARG_OPTIONAL, 58 {"inplace", ARG_INPLACE, N_("BOOL"), OPTION_ARG_OPTIONAL,
59 N_("* annotate the message in place")}, 59 N_("* annotate the message in place")},
60 {"query", ARG_QUERY, N_("BOOL"), OPTION_ARG_OPTIONAL, 60 {"query", ARG_QUERY, N_("BOOL"), OPTION_ARG_OPTIONAL,
61 N_("query for addresses to place in To: and Cc: lists")}, 61 N_("* query for addresses to place in To: and Cc: lists")},
62 {"width", ARG_WIDTH, N_("NUMBER"), 0, N_("set output width")}, 62 {"width", ARG_WIDTH, N_("NUMBER"), 0, N_("set output width")},
63 {"whatnowproc", ARG_WHATNOWPROC, N_("PROG"), 0, 63 {"whatnowproc", ARG_WHATNOWPROC, N_("PROG"), 0,
64 N_("set the replacement for whatnow program")}, 64 N_("set the replacement for whatnow program")},
...@@ -143,8 +143,7 @@ opt_handler (int key, char *arg, struct argp_state *state) ...@@ -143,8 +143,7 @@ opt_handler (int key, char *arg, struct argp_state *state)
143 switch (key) 143 switch (key)
144 { 144 {
145 case ARGP_KEY_INIT: 145 case ARGP_KEY_INIT:
146 draftfolder = mh_global_profile_get ("Draft-Folder", 146 draftfolder = mh_global_profile_get ("Draft-Folder", NULL);
147 mu_folder_directory ());
148 whatnowproc = mh_global_profile_get ("whatnowproc", NULL); 147 whatnowproc = mh_global_profile_get ("whatnowproc", NULL);
149 break; 148 break;
150 149
...@@ -225,6 +224,7 @@ opt_handler (int key, char *arg, struct argp_state *state) ...@@ -225,6 +224,7 @@ opt_handler (int key, char *arg, struct argp_state *state)
225 break; 224 break;
226 225
227 case ARG_QUERY: 226 case ARG_QUERY:
227 mh_opt_notimpl_warning ("-inplace");
228 query_mode = is_true (arg); 228 query_mode = is_true (arg);
229 break; 229 break;
230 230
......
...@@ -55,6 +55,7 @@ TESTSUITE_AT = \ ...@@ -55,6 +55,7 @@ TESTSUITE_AT = \
55 pick.at\ 55 pick.at\
56 scan.at\ 56 scan.at\
57 refile.at\ 57 refile.at\
58 repl.at\
58 rmf.at\ 59 rmf.at\
59 rmm.at\ 60 rmm.at\
60 testsuite.at 61 testsuite.at
......
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2010 Free Software Foundation, Inc.
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3, or (at
7 # your option) any later version.
8 #
9 # GNU Mailutils is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16
17 m4_pushdef([MH_KEYWORDS],[repl])
18 m4_pushdef([replcmd],[repl dnl
19 -editor $abs_top_srcdir/mh/tests/mhed])
20
21 MH_CHECK([repl msg],[repl00 repl-msg],[
22 mkdir Mail/inbox
23 AT_DATA([Mail/inbox/1],[From: gray@example.com
24 To: root@example.com
25 Subject: test input
26
27 message body
28 ])
29 echo "quit" | replcmd +inbox 1 | sed "s|$dir/*||;s| *$||"
30 echo == Mail/draft ==
31 cat Mail/draft
32 ],
33 [0],
34 [-- Editor invocation: Mail/draft
35 -- Input file:
36 To: <gray@example.com>
37 Subject: Re: test input
38 X-Mailer: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
39 --------
40 -- Input file end
41 What now? draft left on "Mail/draft".
42 == Mail/draft ==
43 To: <gray@example.com>
44 Subject: Re: test input
45 X-Mailer: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
46 --------
47 Seen by mhed
48 ])
49
50 MH_CHECK([repl -draftfolder],[repl01 repl-draftfolder],[
51 mkdir Mail/inbox
52 mkdir Mail/drafts
53 AT_DATA([Mail/inbox/1],[From: gray@example.com
54 To: root@example.com
55 Subject: test input
56
57 message body
58 ])
59 echo "quit" | replcmd -draftfolder drafts +inbox 1 | sed "s|$dir/*||;s| *$||"
60 echo == Mail/drafts/1 ==
61 cat Mail/drafts/1
62 ],
63 [0],
64 [-- Editor invocation: Mail/drafts/1
65 -- Input file:
66 To: <gray@example.com>
67 Subject: Re: test input
68 X-Mailer: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
69 --------
70 -- Input file end
71 What now? draft left on "Mail/drafts/1".
72 == Mail/drafts/1 ==
73 To: <gray@example.com>
74 Subject: Re: test input
75 X-Mailer: MH (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
76 --------
77 Seen by mhed
78 ])
79
80 m4_popdef([replcmd])
81 m4_popdef([MH_KEYWORDS])
82 # End of repl.at
...\ No newline at end of file ...\ No newline at end of file
...@@ -59,3 +59,4 @@ m4_include([pick.at]) ...@@ -59,3 +59,4 @@ m4_include([pick.at])
59 m4_include([burst.at]) 59 m4_include([burst.at])
60 m4_include([comp.at]) 60 m4_include([comp.at])
61 m4_include([forw.at]) 61 m4_include([forw.at])
62 m4_include([repl.at])
......