Commit e34d8c16 e34d8c168f9031dbfc2441006e0eb24182ef4389 by Sergey Poznyakoff

mh: fix msgset parser and some more comp compatibility issues; provide testsuite for comp.

* mh/Makefile.am (bin_PROGRAMS): Add mhseq.
* mh/comp.c (main): Rewrite to fix compatibility issues.
* mh/mh.h (MH_MSGSET_UID): New define.
(mh_msgset_t) <flags,size>: New members.
* mh/mh_init.c (mh_draft_message): Bugfix: convert msgset to UIDs.
* mh/mh_msgset.c: Rewrite from scratch.

* mh/tests/comp.at: New file.
* mh/tests/mhseq.at: New file.
* mh/tests/Makefile.am (TESTSUITE_AT): Add comp.at, mhseq.at.
* mh/tests/testsuite.at: Include comp.at and mhseq.at.

* libmailutils/property/mhprop.c (_mh_prop_read_stream): Minor fix.
Do remove empty lines.
* mh/mh_whatnow.c (_whatnow): Detect EOF.
(call_send): Quit after successful send.
1 parent e6927c46
......@@ -113,7 +113,7 @@ _mh_prop_read_stream (mu_header_t *phdr, mu_stream_t stream)
argv[1] = "#";
argv[2] = "-r";
argv[3] = NULL;
rc = mu_filter_create_args (&flt, stream, argv[0], 2, argv,
rc = mu_filter_create_args (&flt, stream, argv[0], 3, argv,
MU_FILTER_DECODE, MU_STREAM_READ);
if (rc)
{
......
......@@ -23,6 +23,7 @@ mh_alias_lex.c
mh_fmtgram.c
mhl
mhn
mhseq
mhparam
mhpath
pick
......
......@@ -33,6 +33,7 @@ bin_PROGRAMS = \
mhn\
mhparam\
mhpath\
mhseq\
pick\
prompter\
refile\
......
......@@ -80,6 +80,7 @@ static int build_only = 0; /* --build flag */
static int use_draft = 0; /* --use flag */
static char *draftmessage = "new";
static const char *draftfolder = NULL;
static int folder_set; /* Folder is set on the command line */
static error_t
opt_handler (int key, char *arg, struct argp_state *state)
......@@ -87,8 +88,7 @@ opt_handler (int key, char *arg, struct argp_state *state)
switch (key)
{
case ARGP_KEY_INIT:
draftfolder = mh_global_profile_get ("Draft-Folder",
mu_folder_directory ());
draftfolder = mh_global_profile_get ("Draft-Folder", NULL);
whatnowproc = mh_global_profile_get ("whatnowproc", NULL);
break;
......@@ -106,6 +106,7 @@ opt_handler (int key, char *arg, struct argp_state *state)
case ARG_FOLDER:
mh_set_current_folder (arg);
folder_set = 1;
break;
case ARG_FORM:
......@@ -126,7 +127,7 @@ opt_handler (int key, char *arg, struct argp_state *state)
break;
case ARG_FILE:
wh_env.draftfile = mh_expand_name (NULL, arg, 0);
wh_env.file = mh_expand_name (NULL, arg, 0);
break;
case ARG_NODRAFTFOLDER:
......@@ -197,7 +198,7 @@ main (int argc, char **argv)
mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
opt_handler, NULL, &index);
if (wh_env.draftfile)
if (wh_env.file)
{
if (build_only)
{
......@@ -205,68 +206,90 @@ main (int argc, char **argv)
exit (1);
}
}
else if (folder_set)
{
wh_env.file = mh_expand_name (NULL, "draft", 0);
}
else
{
if (build_only || !draftfolder)
wh_env.file = mh_expand_name (NULL, "draft", 0);
{
switch (argc - index)
{
case 0:
wh_env.file = mh_expand_name (NULL, "draft", 0);
break;
case 1:
wh_env.file = mh_expand_name (NULL, argv[index], 0);
break;
default:
mu_error (_("only one message at a time!"));
return 1;
}
}
else if (draftfolder)
{
/* Comp accepts a `file', and it will, if given
`-draftfolder +folder' treat this arguments as `msg'. */
if (index < argc)
if (use_draft || index < argc)
{
mh_msgset_t msgset;
mu_mailbox_t mbox;
mbox = mh_open_folder (draftfolder, 1);
mh_msgset_parse (mbox, &msgset, argc - index, argv + index,
"new");
mh_msgset_parse (mbox, &msgset,
argc - index, argv + index,
use_draft ? "cur" : "new");
mu_mailbox_destroy (&mbox);
if (msgset.count != 1)
{
mu_error (_("only one message at a time!"));
return 1;
}
mh_msgset_uids (mbox, &msgset);
draftmessage = mu_umaxtostr (0, msgset.list[0]);
mh_msgset_free (&msgset);
index = argc;
}
if (mh_draft_message (draftfolder, draftmessage,
&wh_env.file))
return 1;
}
wh_env.draftfile = wh_env.file;
}
switch (check_draft_disposition (&wh_env, use_draft))
{
case DISP_QUIT:
exit (0);
wh_env.draftfile = wh_env.file;
case DISP_USE:
break;
case DISP_REPLACE:
unlink (wh_env.draftfile);
if (index < argc)
if (folder_set && index < argc)
{
mh_msgset_t msgset;
mu_mailbox_t mbox;
mbox = mh_open_folder (mh_current_folder (), 0);
mh_msgset_parse (mbox, &msgset, argc - index, argv + index, "cur");
if (msgset.count != 1)
{
mh_msgset_t msgset;
mu_mailbox_t mbox;
mu_error (_("only one message at a time!"));
return 1;
}
unlink (wh_env.file);
copy_message (mbox, msgset.list[0], wh_env.file);
mu_mailbox_destroy (&mbox);
mh_msgset_free (&msgset);
}
else
{
switch (check_draft_disposition (&wh_env, use_draft))
{
case DISP_QUIT:
exit (0);
case DISP_USE:
break;
mbox = mh_open_folder (mh_current_folder (), 0);
mh_msgset_parse (mbox, &msgset, argc - index, argv + index, "cur");
if (msgset.count != 1)
{
mu_error (_("only one message at a time!"));
return 1;
}
copy_message (mbox, msgset.list[0], wh_env.file);
mu_mailbox_destroy (&mbox);
mh_msgset_free (&msgset);
case DISP_REPLACE:
unlink (wh_env.draftfile);
mh_comp_draft (formfile, "components", wh_env.file);
}
else
mh_comp_draft (formfile, "components", wh_env.file);
}
/* Exit immediately if --build is given */
......
......@@ -195,10 +195,14 @@ typedef struct
mu_header_t header;
} mh_context_t;
#define MH_MSGSET_UID 0x01
typedef struct
{
size_t count;
int flags;
size_t *list;
size_t count;
size_t size;
} mh_msgset_t;
typedef void (*mh_iterator_fp) (mu_mailbox_t mbox, mu_message_t msg,
......@@ -300,8 +304,8 @@ int mh_message_number (mu_message_t msg, size_t *pnum);
mu_mailbox_t mh_open_folder (const char *folder, int create);
int mh_msgset_parse (mu_mailbox_t mbox, mh_msgset_t *msgset,
int argc, char **argv, char *def);
void mh_msgset_parse (mu_mailbox_t mbox, mh_msgset_t *msgset,
int argc, char **argv, char *def);
int mh_msgset_member (mh_msgset_t *msgset, size_t num);
void mh_msgset_reverse (mh_msgset_t *msgset);
void mh_msgset_negate (mu_mailbox_t mbox, mh_msgset_t *msgset);
......
......@@ -998,14 +998,14 @@ mh_draft_message (const char *name, const char *msgspec, char **pname)
argv[0] = (char*) msgspec;
argv[1] = NULL;
rc = mh_msgset_parse (mbox, &msgset, 1, argv, "cur");
if (rc)
mu_error (_("invalid message number: %s"), msgspec);
else if (msgset.count > 1)
mh_msgset_parse (mbox, &msgset, 1, argv, "cur");
if (msgset.count > 1)
mu_error (_("only one message at a time!"));
else
uid = msgset.list[0];
{
mh_msgset_uids (mbox, &msgset);
uid = msgset.list[0];
}
mh_msgset_free (&msgset);
}
......
......@@ -346,18 +346,21 @@ _whatnow (struct mh_whatnow_env *wh, struct action_tab *tab)
do
{
size_t n;
handler_fp fun;
printf ("%s ", wh->prompt);
fflush (stdout);
rc = mu_stream_getline (in, &line, &size, NULL);
rc = mu_stream_getline (in, &line, &size, &n);
if (rc)
{
mu_error (_("cannot read input stream: %s"), mu_strerror (rc));
status = 1;
break;
}
if (n == 0)
break;
ws.ws_comment = "#";
rc = mu_wordsplit (line, &ws, wsflags);
if (rc)
......@@ -462,7 +465,10 @@ static int
call_send (struct mh_whatnow_env *wh, int argc, char **argv, int *status)
{
if (invoke ("sendproc", MHBINDIR "/send", argc, argv, wh->file, NULL) == 0)
annotate (wh);
{
annotate (wh);
return 1;
}
return 0;
}
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2010 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Mailutils is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. */
/* MH mhparam command */
#include <mh.h>
static char doc[] = N_("GNU MH mhseq")"\v"
N_("Use -help to obtain the list of traditional MH options.");
static char args_doc[] = N_("[SEQUENCE]");
static struct argp_option options[] = {
{"folder", ARG_FOLDER, N_("FOLDER"), 0,
N_("specify the folder to use")},
{ "uids", 'u', NULL, 0,
N_("show message UIDs (default)")},
{ "numbers", 'n', NULL, 0,
N_("show message numbers") },
{ NULL }
};
/* Traditional MH options */
struct mh_option mh_option[] = {
{ "uid" },
{ NULL }
};
static int uid_option = 1;
static error_t
opt_handler (int key, char *arg, struct argp_state *state)
{
switch (key)
{
case ARG_FOLDER:
mh_set_current_folder (arg);
break;
case 'n':
uid_option = 0;
break;
case 'u':
uid_option = 1;
break;
default:
return ARGP_ERR_UNKNOWN;
}
return 0;
}
int
main (int argc, char **argv)
{
int index;
mu_mailbox_t mbox;
mh_msgset_t msgset;
size_t i;
/* Native Language Support */
MU_APP_INIT_NLS ();
mh_argp_init ();
mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
opt_handler, NULL, &index);
argc -= index;
argv += index;
mbox = mh_open_folder (mh_current_folder (), 0);
mh_msgset_parse (mbox, &msgset, argc, argv, "cur");
if (uid_option)
mh_msgset_uids (mbox, &msgset);
for (i = 0; i < msgset.count; i++)
printf ("%lu\n", (unsigned long) msgset.list[i]);
return 0;
}
......@@ -42,6 +42,7 @@ TESTSUITE_AT = \
ali.at\
anno.at\
burst.at\
comp.at\
folder.at\
inc.at\
install-mh.at\
......@@ -49,6 +50,7 @@ TESTSUITE_AT = \
mhl.at\
mhparam.at\
mhpath.at\
mhseq.at\
pick.at\
scan.at\
refile.at\
......
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2010 Free Software Foundation, Inc.
#
# GNU Mailutils is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3, or (at
# your option) any later version.
#
# GNU Mailutils is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
m4_pushdef([MH_KEYWORDS],[comp])
m4_pushdef([compcmd],[comp dnl
-form $abs_top_srcdir/mh/components dnl
-editor $abs_top_srcdir/mh/tests/mhed])
MH_CHECK([comp -file],[comp00 comp-file],[
dir=`pwd`
echo quit | compcmd -file ./infile | sed "s|$dir/*||;s| *$||"
cat infile
],
[0],
[-- Editor invocation: ./infile
-- Input file:
To:
cc:
Subject:
--------
-- Input file end
What now? draft left on "./infile".
To:
cc:
Subject:
--------
Seen by mhed
])
MH_CHECK([comp -file (del)],[comp01 comp-file_del],[
dir=`pwd`
echo 'quit -delete' | compcmd -file ./infile | sed "s|$dir/*||;s| *$||"
],
[0],
[-- Editor invocation: ./infile
-- Input file:
To:
cc:
Subject:
--------
-- Input file end
What now?])
MH_CHECK([comp file],[comp02 comp_file],[
echo 'quit' | compcmd file | sed "s|$dir/*||;s| *$||"
cat Mail/file
],
[0],
[-- Editor invocation: Mail/file
-- Input file:
To:
cc:
Subject:
--------
-- Input file end
What now? draft left on "Mail/file".
To:
cc:
Subject:
--------
Seen by mhed
])
MH_CHECK([comp -use file],[comp03 comp-use_file],[
AT_DATA([Mail/file],[From: gray
To: root
Subject: test input
message body
])
echo 'quit' | compcmd -use file | sed "s|$dir/*||;s| *$||"
cat Mail/file
],
[0],
[-- Editor invocation: Mail/file
-- Input file:
From: gray
To: root
Subject: test input
message body
-- Input file end
What now? draft left on "Mail/file".
From: gray
To: root
Subject: test input
message body
Seen by mhed
])
MH_CHECK([comp +folder msg],[comp04 comp+folder_msg],[
mkdir Mail/inbox
AT_DATA([Mail/inbox/1],[From: gray
To: root
Subject: test input
message body
])
echo 'quit' | compcmd +inbox 1 | sed "s|$dir/*||;s| *$||"
echo Mail/draft
cat Mail/draft
echo Message
cat Mail/inbox/1
],
[0],
[-- Editor invocation: Mail/draft
-- Input file:
From: gray
To: root
Subject: test input
message body
-- Input file end
What now? draft left on "Mail/draft".
Mail/draft
From: gray
To: root
Subject: test input
message body
Seen by mhed
Message
From: gray
To: root
Subject: test input
message body
])
m4_popdef([compcmd])
m4_popdef([MH_KEYWORDS])
#! /bin/sh
echo "-- Editor invocation:" $*
echo "-- Input file: "
cat $1
echo "-- Input file end"
echo "Seen by mhed" >> $1
exit 0
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2010 Free Software Foundation, Inc.
#
# GNU Mailutils is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3, or (at
# your option) any later version.
#
# GNU Mailutils is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
m4_pushdef([MH_KEYWORDS],[mhseq mh-sequences])
dnl ---------------------------------------------------------------
MH_CHECK([mhseq: existing message number],[mhseq00],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
mhseq 1
],
[0],
[1
])
MH_CHECK([mhseq: not existing message number],[mhseq01],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
mhseq 100
],
[1],
[],
dnl FIXME: See FIXME 3 in mhpath.at
[mhseq: message 100 does not exist
])
MH_CHECK([mhseq: contiguous message range],[mhseq02],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
mhseq 2-5
],
[0],
[2
3
4
5
])
MH_CHECK([mhseq: reversed contiguous message range],[mhseq03],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
mhseq 5-2
],
[0],
[2
3
4
5
])
MH_CHECK([mhseq: reversed non-contiguous message range],[mhseq04],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
rm Mail/inbox/3 Mail/inbox/4
mhseq 5-2
],
[0],
[2
5
])
MH_CHECK([mhseq: message range (left fixup)],[mhseq05],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
rm Mail/inbox/1 Mail/inbox/2
mhseq 1-5
],
[0],
[3
4
5
])
MH_CHECK([mhseq: message range (right fixup)],[mhseq06],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
rm Mail/inbox/4 Mail/inbox/5
mhseq 1-5
],
[0],
[1
2
3
])
MH_CHECK([mhseq: message range (both fixups)],[mhseq07],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
rm Mail/inbox/1 Mail/inbox/5
mhseq 1-5
],
[0],
[2
3
4
])
MH_CHECK([mhseq: non-existent message range (left)],[mhseq08],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
rm Mail/inbox/1 Mail/inbox/2 Mail/inbox/3
mhseq 1-2
],
[1],
[],
[mhseq: no messages in range 1-2
])
MH_CHECK([mhseq: non-existent message range (right)],[mhseq09],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
mhseq 6-10
],
[1],
[],
[mhseq: no messages in range 6-10
])
MH_CHECK([mhseq: message set addition],[mhseq10],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail/inbox])
mhseq 5 8-10 15-20
],
[0],
[5
8
9
10
15
16
17
18
19
20
])
MH_CHECK([mhseq: message set optimization],[mhseq11],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail/inbox])
rm Mail/inbox/17 Mail/inbox/19
mhseq 5 1-10 15-20
],
[0],
[1
2
3
4
5
6
7
8
9
10
15
16
18
20
])
MH_CHECK([mhseq: counted range (positive)],[mhseq12],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail/inbox])
mhseq 10:4
],
[0],
[10
11
12
13
])
MH_CHECK([mhseq: non-contiguous counted range (positive)],[mhseq13],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail/inbox])
rm Mail/inbox/12 Mail/inbox/14
mhseq 10:4
],
[0],
[10
11
13
15
])
MH_CHECK([mhseq: counted range (positive, left fixup)],[mhseq14],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
rm Mail/inbox/1 Mail/inbox/2
mhseq 1:3
],
[0],
[3
4
5
])
MH_CHECK([mhseq: counted range (positive, right fixup)],[mhseq15],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
mhseq 2:10
],
[0],
[2
3
4
5
])
MH_CHECK([mhseq: invalid counted range (negative)],[mhseq16],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
rm Mail/inbox/1 Mail/inbox/2
mhseq 10:2
],
[1],
[],
[mhseq: no messages in range 10:2
])
MH_CHECK([mhseq: counted range (negative)],[mhseq17],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail/inbox])
mhseq 10:-4
],
[0],
[7
8
9
10
])
MH_CHECK([mhseq: non-contiguous counted range (negative)],[mhseq18],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail/inbox])
rm Mail/inbox/8 Mail/inbox/6
mhseq 10:-4
],
[0],
[5
7
9
10
])
MH_CHECK([mhseq: counted range (negative, left fixup)],[mhseq19],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
rm Mail/inbox/1 Mail/inbox/2
mhseq 4:-30
],
[0],
[3
4
])
MH_CHECK([mhseq: counted range (negative, right fixup)],[mhseq20],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
rm Mail/inbox/1 Mail/inbox/2
mhseq 4:30
],
[0],
[4
5
])
MH_CHECK([mhseq: invalid counted range (negative)],[mhseq21],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
rm Mail/inbox/1 Mail/inbox/2
mhseq 1:-30
],
[1],
[],
[mhseq: no messages in range 1:-30
])
MH_CHECK([mhseq: cur],[mhseq22 cur],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
echo "cur: 3" > Mail/inbox/.mh_sequences
mhseq cur
],
[0],
[3
])
MH_CHECK([mhseq: cur:n -- default direction],[mhseq23 cur:n],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
echo "cur: 3" > Mail/inbox/.mh_sequences
mhseq cur:2
],
[0],
[3
4
])
MH_CHECK([mhseq: cur:n -- explicit dir (negative)],[mhseq24 cur:n cur:n-],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
echo "cur: 3" > Mail/inbox/.mh_sequences
mhseq cur:-2
],
[0],
[2
3
])
MH_CHECK([mhseq: cur:n -- explicit dir (positive)],[mhseq25 cur:n cur:n+],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
echo "cur: 3" > Mail/inbox/.mh_sequences
mhseq cur:+2
],
[0],
[3
4
])
MH_CHECK([mhseq: next],[mhseq26 next],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
echo "cur: 3" > Mail/inbox/.mh_sequences
rm Mail/inbox/4
mhseq next
],
[0],
[5
])
MH_CHECK([mhseq: next:n -- default direction],[mhseq27 next:n],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
echo "cur: 3" > Mail/inbox/.mh_sequences
mhseq next:2
],
[0],
[4
5
])
MH_CHECK([mhseq: prev],[mhseq28 prev],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
echo "cur: 3" > Mail/inbox/.mh_sequences
rm Mail/inbox/2
mhseq prev
],
[0],
[1
])
MH_CHECK([mhseq: prev:n -- default direction],[mhseq29 prev:n],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
echo "cur: 3" > Mail/inbox/.mh_sequences
mhseq prev:2
],
[0],
[1
2
])
MH_CHECK([mhseq: first],[mhseq30 first],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
rm Mail/inbox/1
mhseq first
],
[0],
[2
])
MH_CHECK([mhseq: first:n -- default direction],[mhseq31 first:n],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
rm Mail/inbox/1
mhseq first:2
],
[0],
[2
3
])
MH_CHECK([mhseq: last],[mhseq32 last],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
mhseq last
],
[0],
[5
])
MH_CHECK([mhseq: last:n -- default direction],[mhseq33 last:n],[
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
mhseq last:2
],
[0],
[4
5
])
m4_popdef([MH_KEYWORDS])
# End of mhseq.at
\ No newline at end of file
......@@ -42,6 +42,7 @@ AT_CLEANUP
AT_INIT
m4_include([install-mh.at])
m4_include([mhseq.at])
m4_include([ali.at])
m4_include([folder.at])
m4_include([inc.at])
......@@ -56,3 +57,4 @@ m4_include([mhl.at])
m4_include([anno.at])
m4_include([pick.at])
m4_include([burst.at])
m4_include([comp.at])
......