mh: further improvements in mnh & mh testsuite.
* mh/mhn.c (_mhn_profile_get): Try mhn-<prefix>-<type> if mhn-<prefix>-<type>/<subtype> does not exist. (normalize_path): Use mu_normalize_path. (store_handler) <store_to_file>: Honor mhn-<prefix>, if set. * tests/atlocal.in (remove_curdir): New function. * mh/tests/mhn.at: Implement more -store tests. * mh/tests/testsuite.at (MH_SETUP): Set curdir for use by other testcases. * mh/tests/comp.at: Use remove_curdir to sort out the cwd. * mh/tests/forw.at: Likewise. * mh/tests/mark.at: Likewise. * mh/tests/mhpath.at: Likewise. * mh/tests/repl.at: Likewise.
Showing
9 changed files
with
187 additions
and
92 deletions
... | @@ -585,17 +585,16 @@ _mhn_profile_get (const char *prefix, const char *type, const char *subtype, | ... | @@ -585,17 +585,16 @@ _mhn_profile_get (const char *prefix, const char *type, const char *subtype, |
585 | const char *defval) | 585 | const char *defval) |
586 | { | 586 | { |
587 | char *name; | 587 | char *name; |
588 | const char *str; | 588 | const char *str = NULL; |
589 | 589 | ||
590 | if (subtype) | 590 | if (subtype) |
591 | { | 591 | { |
592 | mu_asprintf (&name, "mhn-%s-%s/%s", prefix, type, subtype); | 592 | mu_asprintf (&name, "mhn-%s-%s/%s", prefix, type, subtype); |
593 | str = mh_global_profile_get (name, NULL); | 593 | str = mh_global_profile_get (name, NULL); |
594 | free (name); | 594 | free (name); |
595 | if (!str) | ||
596 | return _mhn_profile_get (prefix, type, NULL, defval); | ||
597 | } | 595 | } |
598 | else | 596 | |
597 | if (!str) | ||
599 | { | 598 | { |
600 | mu_asprintf (&name, "mhn-%s-%s", prefix, type); | 599 | mu_asprintf (&name, "mhn-%s-%s", prefix, type); |
601 | str = mh_global_profile_get (name, defval); | 600 | str = mh_global_profile_get (name, defval); |
... | @@ -1533,58 +1532,16 @@ mhn_show () | ... | @@ -1533,58 +1532,16 @@ mhn_show () |
1533 | char * | 1532 | char * |
1534 | normalize_path (const char *cwd, char *path) | 1533 | normalize_path (const char *cwd, char *path) |
1535 | { | 1534 | { |
1536 | int len; | 1535 | size_t len; |
1537 | char *p; | ||
1538 | char *pcwd = NULL; | 1536 | char *pcwd = NULL; |
1539 | 1537 | ||
1540 | if (!path) | 1538 | if (!path) |
1541 | return path; | 1539 | return path; |
1542 | 1540 | ||
1543 | if (path[0] == '/') | ||
1544 | return NULL; | ||
1545 | |||
1546 | if (!cwd) | 1541 | if (!cwd) |
1547 | cwd = pcwd = mu_getcwd (); | 1542 | cwd = pcwd = mu_getcwd (); |
1548 | 1543 | ||
1549 | path = mh_safe_make_file_name (cwd, path); | 1544 | path = mu_normalize_path (mh_safe_make_file_name (cwd, path)); |
1550 | |||
1551 | /* delete trailing delimiter if any */ | ||
1552 | if (len && path[len-1] == '/') | ||
1553 | path[len-1] = 0; | ||
1554 | |||
1555 | /* Eliminate any /../ */ | ||
1556 | for (p = strchr (path, '.'); p; p = strchr (p, '.')) | ||
1557 | { | ||
1558 | if (p > path && p[-1] == '/') | ||
1559 | { | ||
1560 | if (p[1] == '.' && (p[2] == 0 || p[2] == '/')) | ||
1561 | /* found */ | ||
1562 | { | ||
1563 | char *q, *s; | ||
1564 | |||
1565 | /* Find previous delimiter */ | ||
1566 | for (q = p-2; *q != '/' && q >= path; q--) | ||
1567 | ; | ||
1568 | |||
1569 | if (q < path) | ||
1570 | break; | ||
1571 | /* Copy stuff */ | ||
1572 | s = p + 2; | ||
1573 | p = q; | ||
1574 | while ((*q++ = *s++)) | ||
1575 | ; | ||
1576 | continue; | ||
1577 | } | ||
1578 | } | ||
1579 | |||
1580 | p++; | ||
1581 | } | ||
1582 | |||
1583 | if (path[0] == 0) | ||
1584 | { | ||
1585 | path[0] = '/'; | ||
1586 | path[1] = 0; | ||
1587 | } | ||
1588 | 1545 | ||
1589 | len = strlen (cwd); | 1546 | len = strlen (cwd); |
1590 | if (strlen (path) < len || memcmp (path, cwd, len)) | 1547 | if (strlen (path) < len || memcmp (path, cwd, len)) |
... | @@ -1694,6 +1651,18 @@ store_handler (mu_message_t msg, msg_part_t part, char *type, char *encoding, | ... | @@ -1694,6 +1651,18 @@ store_handler (mu_message_t msg, msg_part_t part, char *type, char *encoding, |
1694 | break; | 1651 | break; |
1695 | 1652 | ||
1696 | case store_to_file: | 1653 | case store_to_file: |
1654 | if (dir && name[0] != '/') | ||
1655 | { | ||
1656 | char *s = mu_make_file_name (dir, name); | ||
1657 | if (!s) | ||
1658 | { | ||
1659 | rc = ENOMEM; | ||
1660 | mu_diag_funcall (MU_DIAG_ERROR, "mu_make_file_name", NULL, rc); | ||
1661 | break; | ||
1662 | } | ||
1663 | free (name); | ||
1664 | name = s; | ||
1665 | } | ||
1697 | printf (_("storing message %s part %s as file %s\n"), | 1666 | printf (_("storing message %s part %s as file %s\n"), |
1698 | prefix, partstr, name); | 1667 | prefix, partstr, name); |
1699 | 1668 | ... | ... |
... | @@ -3,4 +3,6 @@ | ... | @@ -3,4 +3,6 @@ |
3 | # Copyright (C) 2004, 2010 Free Software Foundation, Inc. | 3 | # Copyright (C) 2004, 2010 Free Software Foundation, Inc. |
4 | 4 | ||
5 | PATH=@abs_builddir@:@abs_top_builddir@/mh:$top_srcdir:$srcdir:$PATH | 5 | PATH=@abs_builddir@:@abs_top_builddir@/mh:$top_srcdir:$srcdir:$PATH |
6 | |||
... | \ No newline at end of file | ... | \ No newline at end of file |
6 | remove_curdir() { | ||
7 | sed "s|$curdir/*||;s| *$||" $* | ||
8 | } | ... | ... |
... | @@ -18,8 +18,7 @@ m4_pushdef([MH_KEYWORDS],[comp]) | ... | @@ -18,8 +18,7 @@ m4_pushdef([MH_KEYWORDS],[comp]) |
18 | m4_pushdef([compcmd],[comp -editor $abs_top_srcdir/mh/tests/mhed]) | 18 | m4_pushdef([compcmd],[comp -editor $abs_top_srcdir/mh/tests/mhed]) |
19 | 19 | ||
20 | MH_CHECK([comp -file],[comp00 comp-file],[ | 20 | MH_CHECK([comp -file],[comp00 comp-file],[ |
21 | dir=`pwd` | 21 | echo quit | compcmd -file ./infile | remove_curdir |
22 | echo quit | compcmd -file ./infile | sed "s|$dir/*||;s| *$||" | ||
23 | cat infile | 22 | cat infile |
24 | ], | 23 | ], |
25 | [0], | 24 | [0], |
... | @@ -39,8 +38,7 @@ Seen by mhed | ... | @@ -39,8 +38,7 @@ Seen by mhed |
39 | ]) | 38 | ]) |
40 | 39 | ||
41 | MH_CHECK([comp -file (del)],[comp01 comp-file_del],[ | 40 | MH_CHECK([comp -file (del)],[comp01 comp-file_del],[ |
42 | dir=`pwd` | 41 | echo 'quit -delete' | compcmd -file ./infile | remove_curdir |
43 | echo 'quit -delete' | compcmd -file ./infile | sed "s|$dir/*||;s| *$||" | ||
44 | ], | 42 | ], |
45 | [0], | 43 | [0], |
46 | [-- Editor invocation: ./infile | 44 | [-- Editor invocation: ./infile |
... | @@ -53,7 +51,7 @@ Subject: | ... | @@ -53,7 +51,7 @@ Subject: |
53 | What now?]) | 51 | What now?]) |
54 | 52 | ||
55 | MH_CHECK([comp file],[comp02 comp_file],[ | 53 | MH_CHECK([comp file],[comp02 comp_file],[ |
56 | echo 'quit' | compcmd file | sed "s|$dir/*||;s| *$||" | 54 | echo 'quit' | compcmd file | remove_curdir |
57 | cat Mail/file | 55 | cat Mail/file |
58 | ], | 56 | ], |
59 | [0], | 57 | [0], |
... | @@ -80,7 +78,7 @@ Subject: test input | ... | @@ -80,7 +78,7 @@ Subject: test input |
80 | message body | 78 | message body |
81 | ]) | 79 | ]) |
82 | 80 | ||
83 | echo 'quit' | compcmd -use file | sed "s|$dir/*||;s| *$||" | 81 | echo 'quit' | compcmd -use file | remove_curdir |
84 | cat Mail/file | 82 | cat Mail/file |
85 | ], | 83 | ], |
86 | [0], | 84 | [0], |
... | @@ -110,7 +108,7 @@ Subject: test input | ... | @@ -110,7 +108,7 @@ Subject: test input |
110 | message body | 108 | message body |
111 | ]) | 109 | ]) |
112 | 110 | ||
113 | echo 'quit' | compcmd +inbox 1 | sed "s|$dir/*||;s| *$||" | 111 | echo 'quit' | compcmd +inbox 1 | remove_curdir |
114 | echo Mail/draft | 112 | echo Mail/draft |
115 | cat Mail/draft | 113 | cat Mail/draft |
116 | echo Message | 114 | echo Message |
... | @@ -143,8 +141,7 @@ message body | ... | @@ -143,8 +141,7 @@ message body |
143 | 141 | ||
144 | MH_CHECK([comp -draftfolder],[comp05 comp-draftfolder draftfolder],[ | 142 | MH_CHECK([comp -draftfolder],[comp05 comp-draftfolder draftfolder],[ |
145 | mkdir Mail/drafts | 143 | mkdir Mail/drafts |
146 | dir=`pwd` | 144 | echo 'quit' | compcmd -draftfolder drafts | remove_curdir |
147 | echo 'quit' | compcmd -draftfolder drafts | sed "s|$dir/*||;s| *$||" | ||
148 | cat Mail/drafts/1 | 145 | cat Mail/drafts/1 |
149 | ], | 146 | ], |
150 | [0], | 147 | [0], |
... | @@ -173,8 +170,7 @@ message body | ... | @@ -173,8 +170,7 @@ message body |
173 | ]) | 170 | ]) |
174 | echo "cur: 1" > Mail/drafts/.mh_sequences | 171 | echo "cur: 1" > Mail/drafts/.mh_sequences |
175 | 172 | ||
176 | dir=`pwd` | 173 | echo 'quit' | compcmd -draftfolder drafts -use| remove_curdir |
177 | echo 'quit' | compcmd -draftfolder drafts -use| sed "s|$dir/*||;s| *$||" | ||
178 | cat Mail/drafts/1 | 174 | cat Mail/drafts/1 |
179 | ], | 175 | ], |
180 | [0], | 176 | [0], | ... | ... |
... | @@ -26,8 +26,7 @@ Subject: test input | ... | @@ -26,8 +26,7 @@ Subject: test input |
26 | message body | 26 | message body |
27 | ]) | 27 | ]) |
28 | 28 | ||
29 | dir=`pwd` | 29 | echo quit | forwcmd +inbox 1 | remove_curdir |
30 | echo quit | forwcmd +inbox 1 | sed "s|$dir/*||;s| *$||" | ||
31 | echo == Mail/draft == | 30 | echo == Mail/draft == |
32 | cat Mail/draft | 31 | cat Mail/draft |
33 | echo == Message == | 32 | echo == Message == |
... | @@ -87,8 +86,7 @@ Subject: test input | ... | @@ -87,8 +86,7 @@ Subject: test input |
87 | message body | 86 | message body |
88 | ]) | 87 | ]) |
89 | 88 | ||
90 | dir=`pwd` | 89 | echo quit | forwcmd -format +inbox 1 | remove_curdir |
91 | echo quit | forwcmd -format +inbox 1 | sed "s|$dir/*||;s| *$||" | ||
92 | echo == Mail/draft == | 90 | echo == Mail/draft == |
93 | cat Mail/draft | 91 | cat Mail/draft |
94 | echo == Message == | 92 | echo == Message == |
... | @@ -154,8 +152,7 @@ Subject: 2nd message | ... | @@ -154,8 +152,7 @@ Subject: 2nd message |
154 | 2nd message body | 152 | 2nd message body |
155 | ]) | 153 | ]) |
156 | 154 | ||
157 | dir=`pwd` | 155 | echo quit | forwcmd +inbox 1 2 | remove_curdir |
158 | echo quit | forwcmd +inbox 1 2 | sed "s|$dir/*||;s| *$||" | ||
159 | echo == Mail/draft == | 156 | echo == Mail/draft == |
160 | cat Mail/draft | 157 | cat Mail/draft |
161 | echo == Message 1 == | 158 | echo == Message 1 == |
... | @@ -239,8 +236,7 @@ Subject: test input | ... | @@ -239,8 +236,7 @@ Subject: test input |
239 | message body | 236 | message body |
240 | ]) | 237 | ]) |
241 | 238 | ||
242 | dir=`pwd` | 239 | forwcmd -build +inbox 1 | remove_curdir |
243 | forwcmd -build +inbox 1 | sed "s|$dir/*||;s| *$||" | ||
244 | echo == Mail/draft == | 240 | echo == Mail/draft == |
245 | cat Mail/draft | 241 | cat Mail/draft |
246 | echo == Message == | 242 | echo == Message == |
... | @@ -285,10 +281,9 @@ Subject: 2nd message | ... | @@ -285,10 +281,9 @@ Subject: 2nd message |
285 | 2nd message body | 281 | 2nd message body |
286 | ]) | 282 | ]) |
287 | 283 | ||
288 | dir=`pwd` | 284 | forwcmd -build -mime +inbox 1 2 | remove_curdir |
289 | forwcmd -build -mime +inbox 1 2 | sed "s|$dir/*||;s| *$||" | ||
290 | echo == Mail/draft == | 285 | echo == Mail/draft == |
291 | sed "s|$dir/*||;s| *$||" Mail/draft | 286 | remove_curdir Mail/draft |
292 | echo == Message 1 == | 287 | echo == Message 1 == |
293 | sed '/^X-IMAPbase/d' Mail/inbox/1 | 288 | sed '/^X-IMAPbase/d' Mail/inbox/1 |
294 | echo == Message 2 == | 289 | echo == Message 2 == |
... | @@ -326,7 +321,7 @@ Subject: test input | ... | @@ -326,7 +321,7 @@ Subject: test input |
326 | message body | 321 | message body |
327 | ]) | 322 | ]) |
328 | 323 | ||
329 | echo "quit" | forwcmd -draftfolder drafts 1 | sed "s|$dir/*||;s| *$||" | 324 | echo "quit" | forwcmd -draftfolder drafts 1 | remove_curdir |
330 | echo == Mail/drafts/1 == | 325 | echo == Mail/drafts/1 == |
331 | cat Mail/drafts/1 | 326 | cat Mail/drafts/1 |
332 | echo == Message == | 327 | echo == Message == |
... | @@ -383,7 +378,7 @@ Subject: test input | ... | @@ -383,7 +378,7 @@ Subject: test input |
383 | message body | 378 | message body |
384 | ]) | 379 | ]) |
385 | 380 | ||
386 | echo "quit" | forwcmd -file infile | sed "s|$dir/*||;s| *$||" | 381 | echo "quit" | forwcmd -file infile | remove_curdir |
387 | ], | 382 | ], |
388 | [0], | 383 | [0], |
389 | [-- Editor invocation: Mail/draft | 384 | [-- Editor invocation: Mail/draft | ... | ... |
... | @@ -44,7 +44,6 @@ MH_CHECK([mark -add -nopublic],[mark02 mark-add-nopublic],[ | ... | @@ -44,7 +44,6 @@ MH_CHECK([mark -add -nopublic],[mark02 mark-add-nopublic],[ |
44 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) | 44 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) |
45 | echo 'Current-Folder: inbox' > Mail/context | 45 | echo 'Current-Folder: inbox' > Mail/context |
46 | mark -nopublic -sequence andro -add 1 2 3 | 46 | mark -nopublic -sequence andro -add 1 2 3 |
47 | dir=`pwd` | ||
48 | sed -n '/^atr-andro/{s/ */ /g;s/ $//;s/^[[^:]]*:/atr-andro:/;p}' Mail/context | 47 | sed -n '/^atr-andro/{s/ */ /g;s/ $//;s/^[[^:]]*:/atr-andro:/;p}' Mail/context |
49 | ], | 48 | ], |
50 | [0], | 49 | [0], | ... | ... |
... | @@ -127,5 +127,144 @@ Do you think I can listen all day to such stuff? | ... | @@ -127,5 +127,144 @@ Do you think I can listen all day to such stuff? |
127 | Be off, or I'll kick you down stairs!' | 127 | Be off, or I'll kick you down stairs!' |
128 | ]) | 128 | ]) |
129 | 129 | ||
130 | MH_CHECK([mhn -store -auto],[mhn03 mhn-store-auto],[ | ||
131 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) | ||
132 | mhn +inbox -store -auto 4 | remove_curdir || exit $? | ||
133 | ], | ||
134 | [0], | ||
135 | [storing message 4 part 1 as file msg.21 | ||
136 | storing message 4 part 2.1 as file msg.22 | ||
137 | storing message 4 part 2.2.1 as file msg.23 | ||
138 | storing message 4 part 2.2.2 as file msg.24 | ||
139 | ]) | ||
140 | |||
141 | MH_CHECK([mhn -store -auto -part],[mhn04 mhn-store-auto-part],[ | ||
142 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) | ||
143 | mhn +inbox -store -auto -part 2.2.1 4 | remove_curdir || exit $? | ||
144 | ], | ||
145 | [0], | ||
146 | [storing message 4 part 2.2.1 as file msg.23 | ||
147 | ]) | ||
148 | |||
149 | MH_CHECK([mhn -store -auto (pathname safety)],[mhn05 mhn-store-auto-safety],[ | ||
150 | mkdir Mail/inbox | ||
151 | sed 's|; *name="msg|; name="../msg|' \ | ||
152 | $abs_top_srcdir/testsuite/mh/mbox1/4 > Mail/inbox/4 | ||
153 | mhn +inbox -store -auto -part 2.1 4 || echo $? | ||
154 | echo == 4.2.1.octet-stream == | ||
155 | cat 4.2.1.octet-stream | ||
156 | ], | ||
157 | [0], | ||
158 | [storing message 4 part 2.1 as file 4.2.1.octet-stream | ||
159 | == 4.2.1.octet-stream == | ||
160 | `You are old,' said the youth, `as I mentioned before, | ||
161 | And have grown most uncommonly fat; | ||
162 | Yet you turned a back-somersault in at the door-- | ||
163 | Pray, what is the reason of that?' | ||
164 | |||
165 | `In my youth,' said the sage, as he shook his grey locks, | ||
166 | `I kept all my limbs very supple | ||
167 | By the use of this ointment--one shilling the box-- | ||
168 | Allow me to sell you a couple?' | ||
169 | ]) | ||
170 | |||
171 | MH_CHECK([mhn-storage],[mhn06 mhn-store-auto],[ | ||
172 | mkdir Mail/inbox | ||
173 | cp $abs_top_srcdir/testsuite/mh/mbox1/4 Mail/inbox | ||
174 | |||
175 | mkdir out | ||
176 | echo "mhn-storage: $curdir/out" >> $MH | ||
177 | |||
178 | mhn +inbox -store 4 | remove_curdir || echo $? | ||
179 | ], | ||
180 | [0], | ||
181 | [storing message 4 part 1 as file out/4.1.plain | ||
182 | storing message 4 part 2.1 as file out/4.2.1.octet-stream | ||
183 | storing message 4 part 2.2.1 as file out/4.2.2.1.octet-stream | ||
184 | storing message 4 part 2.2.2 as file out/4.2.2.2.octet-stream | ||
185 | ]) | ||
186 | |||
187 | MH_CHECK([mhn-store-: all escapes],[mhn07 mhn-store_escapes],[ | ||
188 | mkdir Mail/inbox | ||
189 | cp $abs_top_srcdir/testsuite/mh/mbox1/4 Mail/inbox | ||
190 | echo "mhn-store-application: %%-%m%P.%s-%p" >> $MH | ||
191 | mhn +inbox -store 4 | remove_curdir || exit $? | ||
192 | find . -name '%*' | ||
193 | ], | ||
194 | [0], | ||
195 | [storing message 4 part 1 as file 4.1.plain | ||
196 | storing message 4 part 2.1 as file %4.2.1.octet-stream-2.1 | ||
197 | storing message 4 part 2.2.1 as file %4.2.2.1.octet-stream-2.2.1 | ||
198 | storing message 4 part 2.2.2 as file %4.2.2.2.octet-stream-2.2.2 | ||
199 | ./%4.2.1.octet-stream-2.1 | ||
200 | ./%4.2.2.1.octet-stream-2.2.1 | ||
201 | ./%4.2.2.2.octet-stream-2.2.2 | ||
202 | ]) | ||
203 | |||
204 | MH_CHECK([mhn-store-: absolute path],[mhn08 mhn-store_abspath],[ | ||
205 | mkdir Mail/inbox | ||
206 | mkdir out | ||
207 | cp $abs_top_srcdir/testsuite/mh/mbox1/4 Mail/inbox | ||
208 | echo "mhn-store-application: $curdir/out/%m%P.%s" >> $MH | ||
209 | mhn +inbox -store 4 | remove_curdir || exit $? | ||
210 | ], | ||
211 | [0], | ||
212 | [storing message 4 part 1 as file 4.1.plain | ||
213 | storing message 4 part 2.1 as file out/4.2.1.octet-stream | ||
214 | storing message 4 part 2.2.1 as file out/4.2.2.1.octet-stream | ||
215 | storing message 4 part 2.2.2 as file out/4.2.2.2.octet-stream | ||
216 | ]) | ||
217 | |||
218 | MH_CHECK([mhn-store-: +folder],[mhn09 mhn-store+folder],[ | ||
219 | mkdir Mail/inbox | ||
220 | mkdir Mail/app | ||
221 | cp $abs_top_srcdir/testsuite/mh/mbox1/4 Mail/inbox | ||
222 | echo "mhn-store-application: +app" >> $MH | ||
223 | mhn +inbox -store 4 | remove_curdir || exit $? | ||
224 | ], | ||
225 | [0], | ||
226 | [storing message 4 part 1 as file 4.1.plain | ||
227 | storing message 4 part 2.1 to folder +app as message 1 | ||
228 | storing message 4 part 2.2.1 to folder +app as message 2 | ||
229 | storing message 4 part 2.2.2 to folder +app as message 3 | ||
230 | ]) | ||
231 | |||
232 | MH_CHECK([mhn-store-: +],[mhn10 mhn-store+],[ | ||
233 | mkdir Mail/inbox | ||
234 | cp $abs_top_srcdir/testsuite/mh/mbox1/4 Mail/inbox | ||
235 | echo "Current-Folder: inbox" > Mail/context | ||
236 | cat >> $MH <<EOT | ||
237 | mhn-store-application/octet-stream: + | ||
238 | EOT | ||
239 | mhn +inbox -store -part 2.2.1 4 | remove_curdir || exit $? | ||
240 | ], | ||
241 | [0], | ||
242 | [storing message 4 part 2.2.1 to folder inbox as message 5 | ||
243 | ]) | ||
244 | |||
245 | MH_CHECK([mhn-store-: pipe],[mhn11 mhn-store-pipe],[ | ||
246 | mkdir Mail/inbox | ||
247 | cp $abs_top_srcdir/testsuite/mh/mbox1/4 Mail/inbox | ||
248 | echo "Current-Folder: inbox" > Mail/context | ||
249 | echo "mhn-store-text: | $abs_top_srcdir/mh/tests/mhed -" >> $MH | ||
250 | mhn +inbox -store -part 1 4 | sed 's| *$||' || exit $? | ||
251 | ], | ||
252 | [0], | ||
253 | [-- Editor invocation: - | ||
254 | -- Input file: | ||
255 | `You are old, Father William,' the young man said, | ||
256 | `And your hair has become very white; | ||
257 | And yet you incessantly stand on your head-- | ||
258 | Do you think, at your age, it is right?' | ||
259 | |||
260 | `In my youth,' Father William replied to his son, | ||
261 | `I feared it might injure the brain; | ||
262 | But, now that I'm perfectly sure I have none, | ||
263 | Why, I do it again and again.' | ||
264 | |||
265 | -- Input file end | ||
266 | storing msg 4 part 1 using command /home/gray/gnu/mailutils/mh/tests/mhed - | ||
267 | ]) | ||
268 | |||
130 | m4_popdef[MH_KEYWORDS]) | 269 | m4_popdef[MH_KEYWORDS]) |
131 | # End of mhn.at | 270 | # End of mhn.at | ... | ... |
... | @@ -19,7 +19,7 @@ m4_pushdef([MH_KEYWORDS],[mhpath]) | ... | @@ -19,7 +19,7 @@ m4_pushdef([MH_KEYWORDS],[mhpath]) |
19 | MH_CHECK([mhpath],[mhpath00],[ | 19 | MH_CHECK([mhpath],[mhpath00],[ |
20 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) | 20 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) |
21 | echo 'Current-Folder: inbox' > Mail/context | 21 | echo 'Current-Folder: inbox' > Mail/context |
22 | mhpath | sed 's|^'"$dir"'/||' | 22 | mhpath | remove_curdir |
23 | ], | 23 | ], |
24 | [0], | 24 | [0], |
25 | [Mail/inbox | 25 | [Mail/inbox |
... | @@ -28,7 +28,7 @@ mhpath | sed 's|^'"$dir"'/||' | ... | @@ -28,7 +28,7 @@ mhpath | sed 's|^'"$dir"'/||' |
28 | MH_CHECK([mhpath +],[mhpath01 mhpath+],[ | 28 | MH_CHECK([mhpath +],[mhpath01 mhpath+],[ |
29 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) | 29 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) |
30 | echo 'Current-Folder: inbox' > Mail/context | 30 | echo 'Current-Folder: inbox' > Mail/context |
31 | mhpath +| sed 's|^'"$dir"'/||' | 31 | mhpath +| remove_curdir |
32 | ], | 32 | ], |
33 | [0], | 33 | [0], |
34 | 34 | ||
... | @@ -36,8 +36,7 @@ mhpath +| sed 's|^'"$dir"'/||' | ... | @@ -36,8 +36,7 @@ mhpath +| sed 's|^'"$dir"'/||' |
36 | 36 | ||
37 | MH_CHECK([mhpath msgs],[mhpath02 mhparam_msgs],[ | 37 | MH_CHECK([mhpath msgs],[mhpath02 mhparam_msgs],[ |
38 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) | 38 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) |
39 | dir=`pwd` | 39 | mhpath 1-3 | remove_curdir |
40 | mhpath 1-3 | sed 's|^'"$dir"'/||' | ||
41 | ], | 40 | ], |
42 | [0], | 41 | [0], |
43 | [Mail/inbox/1 | 42 | [Mail/inbox/1 |
... | @@ -47,8 +46,7 @@ Mail/inbox/3 | ... | @@ -47,8 +46,7 @@ Mail/inbox/3 |
47 | 46 | ||
48 | MH_CHECK([mhpath msgs (some nonexistent)],[mhpath03 mhparam_msgs_some_nonex],[ | 47 | MH_CHECK([mhpath msgs (some nonexistent)],[mhpath03 mhparam_msgs_some_nonex],[ |
49 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) | 48 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) |
50 | dir=`pwd` | 49 | mhpath 4-10 | remove_curdir |
51 | mhpath 4-10 | sed 's|^'"$dir"'/||' | ||
52 | ], | 50 | ], |
53 | [0], | 51 | [0], |
54 | [Mail/inbox/4 | 52 | [Mail/inbox/4 |
... | @@ -57,8 +55,7 @@ Mail/inbox/5 | ... | @@ -57,8 +55,7 @@ Mail/inbox/5 |
57 | 55 | ||
58 | MH_CHECK([mhpath msgs (all nonexistent)],[mhpath04 mhparam_msgs_all_nonex],[ | 56 | MH_CHECK([mhpath msgs (all nonexistent)],[mhpath04 mhparam_msgs_all_nonex],[ |
59 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) | 57 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) |
60 | dir=`pwd` | 58 | mhpath 8-10 | remove_curdir |
61 | mhpath 8-10 | sed 's|^'"$dir"'/||' | ||
62 | ], | 59 | ], |
63 | [0], | 60 | [0], |
64 | [], | 61 | [], |
... | @@ -89,8 +86,7 @@ mhpath 8-10 | sed 's|^'"$dir"'/||' | ... | @@ -89,8 +86,7 @@ mhpath 8-10 | sed 's|^'"$dir"'/||' |
89 | 86 | ||
90 | MH_CHECK([mhpath nonexistent],[mhpath05 mhparam_nonexistent],[ | 87 | MH_CHECK([mhpath nonexistent],[mhpath05 mhparam_nonexistent],[ |
91 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) | 88 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) |
92 | dir=`pwd` | 89 | mhpath 10 | remove_curdir |
93 | mhpath 10 | sed 's|^'"$dir"'/||' | ||
94 | ], | 90 | ], |
95 | [0], | 91 | [0], |
96 | [], | 92 | [], |
... | @@ -99,8 +95,7 @@ mhpath 10 | sed 's|^'"$dir"'/||' | ... | @@ -99,8 +95,7 @@ mhpath 10 | sed 's|^'"$dir"'/||' |
99 | 95 | ||
100 | MH_CHECK([mhpath new],[mhpath06 mhparam_new],[ | 96 | MH_CHECK([mhpath new],[mhpath06 mhparam_new],[ |
101 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) | 97 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox]) |
102 | dir=`pwd` | 98 | mhpath new | remove_curdir |
103 | mhpath new | sed 's|^'"$dir"'/||' | ||
104 | ], | 99 | ], |
105 | [0], | 100 | [0], |
106 | [Mail/inbox/6 | 101 | [Mail/inbox/6 | ... | ... |
... | @@ -26,7 +26,7 @@ Subject: test input | ... | @@ -26,7 +26,7 @@ Subject: test input |
26 | 26 | ||
27 | message body | 27 | message body |
28 | ]) | 28 | ]) |
29 | echo "quit" | replcmd +inbox 1 | sed "s|$dir/*||;s| *$||" | 29 | echo "quit" | replcmd +inbox 1 | remove_curdir |
30 | echo == Mail/draft == | 30 | echo == Mail/draft == |
31 | cat Mail/draft | 31 | cat Mail/draft |
32 | ], | 32 | ], |
... | @@ -56,7 +56,7 @@ Subject: test input | ... | @@ -56,7 +56,7 @@ Subject: test input |
56 | 56 | ||
57 | message body | 57 | message body |
58 | ]) | 58 | ]) |
59 | echo "quit" | replcmd -draftfolder drafts +inbox 1 | sed "s|$dir/*||;s| *$||" | 59 | echo "quit" | replcmd -draftfolder drafts +inbox 1 | remove_curdir |
60 | echo == Mail/drafts/1 == | 60 | echo == Mail/drafts/1 == |
61 | cat Mail/drafts/1 | 61 | cat Mail/drafts/1 |
62 | ], | 62 | ], |
... | @@ -79,4 +79,4 @@ Seen by mhed | ... | @@ -79,4 +79,4 @@ Seen by mhed |
79 | 79 | ||
80 | m4_popdef([replcmd]) | 80 | m4_popdef([replcmd]) |
81 | m4_popdef([MH_KEYWORDS]) | 81 | m4_popdef([MH_KEYWORDS]) |
82 | # End of repl.at | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
82 | # End of repl.at | ... | ... |
... | @@ -18,11 +18,11 @@ m4_include([testsuite.inc]) | ... | @@ -18,11 +18,11 @@ m4_include([testsuite.inc]) |
18 | 18 | ||
19 | m4_define([MH_SETUP],[ | 19 | m4_define([MH_SETUP],[ |
20 | test -d Mail || mkdir Mail | 20 | test -d Mail || mkdir Mail |
21 | dir=`pwd` | 21 | curdir=`pwd` |
22 | MH=$dir/mh_profile | 22 | MH=$curdir/mh_profile |
23 | export MH | 23 | export MH |
24 | cat > $MH <<EOT | 24 | cat > $MH <<EOT |
25 | Path: $dir/Mail | 25 | Path: $curdir/Mail |
26 | mhetcdir: $abs_top_srcdir/mh/etc | 26 | mhetcdir: $abs_top_srcdir/mh/etc |
27 | EOT | 27 | EOT |
28 | exec <&- | 28 | exec <&- | ... | ... |
-
Please register or sign in to post a comment