unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Cc: David Bremner <bremner@debian.org>
Subject: [PATCH 3/4] test/dump-restore: add tests for notmuch restore --match
Date: Sat, 29 Oct 2011 00:04:50 -0300	[thread overview]
Message-ID: <1319857491-12298-4-git-send-email-david@tethera.net> (raw)
In-Reply-To: <1319857491-12298-1-git-send-email-david@tethera.net>

From: David Bremner <bremner@debian.org>

The first test passes now because it only needs command line parsing.
The other three are marked broken, with functionality to follow.
---
 test/dump-restore |   43 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/test/dump-restore b/test/dump-restore
index c6089f9..18925a4 100755
--- a/test/dump-restore
+++ b/test/dump-restore
@@ -65,6 +65,49 @@ test_expect_equal 'compiling regex notmuch.*[: Invalid regular expression'\
 test_expect_success 'restore --match=<good regex>' \
     'notmuch restore --match="notmuch.*" < /dev/null > /dev/null 2>&1'
 
+test_expect_success 'Restoring with trivial match' \
+  'notmuch restore --match="." dump.expected &&
+  notmuch dump > dump.actual &&
+  test_cmp dump.expected dump.actual'
+
+sed 's/inbox\|unread\|signed//g' < dump-ABC_DEF.expected > dump-ABC_DEF-only
+
+test_subtest_known_broken
+test_expect_success 'Simulate accumulate with match' \
+  'notmuch restore < dump.expected &&
+   notmuch restore --match="(ABC|DEF)" < dump-ABC_DEF-only &&
+   notmuch dump > dump-simulate.actual &&
+   notmuch restore < dump.expected &&
+   test_cmp dump-ABC_DEF.expected dump-simulate.actual'
+
+test_subtest_known_broken
+test_expect_success 'clear only matched tags' \
+  'notmuch restore < dump-ABC_DEF.expected &&
+   notmuch restore --match="(ABC|DEF)" < clear.expected &&
+   notmuch dump > dump-clear-match.actual &&
+   notmuch restore < dump.expected &&
+   test_cmp dump.expected dump-clear-match.actual'
+
+test_subtest_known_broken
+test_expect_success 'import only matched tags' \
+  'notmuch restore < dump.expected &&
+   notmuch restore --match="(inbox|unread)" < dump-ABC_DEF.expected &&
+   notmuch dump > dump-import-match.actual &&
+   notmuch restore < dump.expected &&
+   test_cmp dump.expected dump-import-match.actual'
+
+sed 's/inbox\|unread\|signed\|ABC//g' < dump-ABC_DEF.expected > dump-DEF-only
+sed 's/inbox\|unread\|signed\|DEF//g' < dump-ABC_DEF.expected > dump-ABC-only
+
+test_subtest_known_broken
+test_expect_success 'combine --match and --accumulate' \
+  'notmuch restore < dump.expected &&
+   notmuch restore --match="(ABC|DEF)" < dump-ABC-only &&
+   notmuch restore --accumulate --match="(ABC|DEF)" < dump-DEF-only &&
+   notmuch dump > dump-combine-match.actual &&
+   notmuch restore < dump.expected &&
+   test_cmp dump-ABC_DEF.expected dump-combine-match.actual'
+
 test_begin_subtest "dump outfile"
 notmuch dump dump-outfile.actual
 test_expect_equal_file dump.expected dump-outfile.actual
-- 
1.7.6.3

  parent reply	other threads:[~2011-10-29  3:05 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-23 15:18 [PATCH] xutil.c: remove duplicate copies, create new library libutil.a to contain xutil David Bremner
2011-10-23 21:51 ` [PATCH] xregcomp: don't consider every regex compilation failure an internal error David Bremner
2011-10-29  3:04   ` David Bremner
2011-10-29  3:04     ` [PATCH 1/4] notmuch-restore: add tests for new --match command line argument David Bremner
2011-10-29  3:04     ` [PATCH 2/4] notmuch-restore: implement argument parsing for --match David Bremner
2011-10-29  3:04     ` David Bremner [this message]
2011-10-29  3:04     ` [PATCH 4/4] notmuch-restore: implement --match functionality David Bremner
2011-10-29 16:45       ` Experimental Tag Sharing David Bremner
2011-10-29 16:45         ` [PATCH] contrib/nmbug: new script for sharing tags with prefix notmuch:: David Bremner
2011-10-29 21:11           ` Ali Polatel
2011-10-29 22:12             ` David Bremner
2011-10-30  0:21               ` Ali Polatel
2011-11-07  0:59           ` [PATCH] contrib/nmbug: new script for sharing tags with a given prefix David Bremner
2011-11-07 12:58             ` Tomi Ollila
2011-11-11 15:08             ` [PATCH v3] " David Bremner
2011-11-11 23:26               ` Jameson Graef Rollins
2011-11-11 23:55                 ` David Bremner
2011-11-12  2:43                   ` Jameson Graef Rollins
2011-11-12  5:52                     ` David Bremner
2011-11-13  1:39               ` David Bremner
2011-10-29 17:27         ` [PATCH v2] contrib/nmbug: new script for sharing tags with prefix notmuch:: David Bremner
2011-10-30  0:44         ` Experimental Tag Sharing Jameson Graef Rollins
2011-10-30  2:18           ` David Bremner
2011-10-29 20:55       ` [PATCH] docs: man, online help, and NEWS updated for notmuch restore --match David Bremner
2011-10-31 19:01         ` [PATCH] Fix formatting for restore and dump help documentation Jameson Graef Rollins
2011-11-01  0:19           ` David Bremner
2011-10-29 18:52 ` [PATCH] xutil.c: remove duplicate copies, create new library libutil.a to contain xutil David Bremner
2011-10-31  0:04 ` Austin Clements
2011-10-31  0:09 ` Jameson Graef Rollins
2011-10-31  2:28   ` David Bremner
2011-10-31  9:20 ` Jani Nikula
2011-10-31 10:51   ` David Bremner
2011-10-31 18:50   ` Jameson Graef Rollins
2011-10-31 19:19     ` Jani Nikula
2011-10-31 19:20       ` Jameson Graef Rollins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1319857491-12298-4-git-send-email-david@tethera.net \
    --to=david@tethera.net \
    --cc=bremner@debian.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).