diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2020-11-14 09:29:02 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2020-11-14 09:29:02 +0200 |
commit | b46bf2097ea1ac6fe6bf0936bfe8d3109defc685 (patch) | |
tree | 36219a44fc78b86bea1ee1cae8c9aabd148e9330 /libmailutils | |
parent | fd9b19bac2058d5a338024a343a0773bbcc64df3 (diff) | |
download | mailutils-b46bf2097ea1ac6fe6bf0936bfe8d3109defc685.tar.gz mailutils-b46bf2097ea1ac6fe6bf0936bfe8d3109defc685.tar.bz2 |
Maildir testsuite core
* libmailutils/tests/tesh.c (mu_tesh_read_and_eval): Print fixed
prompt if attached to a terminal.
* libproto/maildir/Makefile.am (SUBDIRS): Add tests.
* libproto/maildir/mbox.c (flags_to_info): Be sure to format each
flag only once.
(maildir_scan_unlocked): Save updated properties.
* testsuite/.gitignore: Add mbox2dir.
* testsuite/Makefile.am: Build mbox2dir.
* testsuite/mbop.c: New file.
* testsuite/mbox2dir.c: New file.
* libproto/maildir/tests/.gitignore: New file.
* libproto/maildir/tests/Makefile.am: New file.
* libproto/maildir/tests/atlocal.in: New file.
* libproto/maildir/tests/attfixup.at: New file.
* libproto/maildir/tests/count.at: New file.
* libproto/maildir/tests/testsuite.at: New file.
* libproto/maildir/tests/uidfixup.at: New file.
Diffstat (limited to 'libmailutils')
-rw-r--r-- | libmailutils/tests/tesh.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/libmailutils/tests/tesh.c b/libmailutils/tests/tesh.c index dd4d05338..bbcf7a887 100644 --- a/libmailutils/tests/tesh.c +++ b/libmailutils/tests/tesh.c @@ -334,17 +334,33 @@ mu_tesh_read_and_eval (int argc, char **argv, struct mu_wordsplit ws; int wsflags; int rc; + mu_transport_t trans[2]; + int interactive; + if (mu_stream_ioctl (mu_strin, MU_IOCTL_TRANSPORT, MU_IOCTL_OP_GET, trans) == 0) + interactive = isatty ((intptr_t)trans[0]); + else + interactive = 0; + wsflags = MU_WRDSF_DEFFLAGS | MU_WRDSF_COMMENT | MU_WRDSF_ALLOC_DIE | MU_WRDSF_SHOWERR; ws.ws_comment = "#"; - while ((rc = mu_stream_getline (mu_strin, &buf, &size, &n)) == 0 && n > 0) + while (1) { char *larg[2]; + if (interactive) + { + mu_stream_printf (mu_strout, "%s", "(tesh) "); + mu_stream_flush (mu_strout); + } + if ((rc = mu_stream_getline (mu_strin, &buf, &size, &n)) != 0 || + n == 0) + break; + mu_ltrim_class (buf, MU_CTYPE_SPACE); mu_rtrim_class (buf, MU_CTYPE_SPACE); |