1 Return-Path: <bremner@tethera.net>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 32748429E2E
\r
6 for <notmuch@notmuchmail.org>; Fri, 28 Oct 2011 20:05:10 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id w01V3cl-J0Sw for <notmuch@notmuchmail.org>;
\r
16 Fri, 28 Oct 2011 20:05:08 -0700 (PDT)
\r
17 Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21])
\r
18 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id E1EE9429E30
\r
21 for <notmuch@notmuchmail.org>; Fri, 28 Oct 2011 20:05:03 -0700 (PDT)
\r
22 Received: from zancas.localnet
\r
23 (fctnnbsc36w-156034064058.pppoe-dynamic.High-Speed.nb.bellaliant.net
\r
24 [156.34.64.58]) (authenticated bits=0)
\r
25 by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id p9T34x81016364
\r
26 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);
\r
27 Sat, 29 Oct 2011 00:05:00 -0300
\r
28 Received: from bremner by zancas.localnet with local (Exim 4.76)
\r
29 (envelope-from <bremner@tethera.net>)
\r
30 id 1RJzEB-0003DG-3m; Sat, 29 Oct 2011 00:04:59 -0300
\r
31 From: David Bremner <david@tethera.net>
\r
32 To: notmuch@notmuchmail.org
\r
33 Subject: [PATCH 3/4] test/dump-restore: add tests for notmuch restore --match
\r
34 Date: Sat, 29 Oct 2011 00:04:50 -0300
\r
35 Message-Id: <1319857491-12298-4-git-send-email-david@tethera.net>
\r
36 X-Mailer: git-send-email 1.7.6.3
\r
37 In-Reply-To: <1319857491-12298-1-git-send-email-david@tethera.net>
\r
38 References: <1319406673-7208-1-git-send-email-david@tethera.net>
\r
39 <1319857491-12298-1-git-send-email-david@tethera.net>
\r
40 Cc: David Bremner <bremner@debian.org>
\r
41 X-BeenThere: notmuch@notmuchmail.org
\r
42 X-Mailman-Version: 2.1.13
\r
44 List-Id: "Use and development of the notmuch mail system."
\r
45 <notmuch.notmuchmail.org>
\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
49 List-Post: <mailto:notmuch@notmuchmail.org>
\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
53 X-List-Received-Date: Sat, 29 Oct 2011 03:05:10 -0000
\r
55 From: David Bremner <bremner@debian.org>
\r
57 The first test passes now because it only needs command line parsing.
\r
58 The other three are marked broken, with functionality to follow.
\r
60 test/dump-restore | 43 +++++++++++++++++++++++++++++++++++++++++++
\r
61 1 files changed, 43 insertions(+), 0 deletions(-)
\r
63 diff --git a/test/dump-restore b/test/dump-restore
\r
64 index c6089f9..18925a4 100755
\r
65 --- a/test/dump-restore
\r
66 +++ b/test/dump-restore
\r
67 @@ -65,6 +65,49 @@ test_expect_equal 'compiling regex notmuch.*[: Invalid regular expression'\
\r
68 test_expect_success 'restore --match=<good regex>' \
\r
69 'notmuch restore --match="notmuch.*" < /dev/null > /dev/null 2>&1'
\r
71 +test_expect_success 'Restoring with trivial match' \
\r
72 + 'notmuch restore --match="." dump.expected &&
\r
73 + notmuch dump > dump.actual &&
\r
74 + test_cmp dump.expected dump.actual'
\r
76 +sed 's/inbox\|unread\|signed//g' < dump-ABC_DEF.expected > dump-ABC_DEF-only
\r
78 +test_subtest_known_broken
\r
79 +test_expect_success 'Simulate accumulate with match' \
\r
80 + 'notmuch restore < dump.expected &&
\r
81 + notmuch restore --match="(ABC|DEF)" < dump-ABC_DEF-only &&
\r
82 + notmuch dump > dump-simulate.actual &&
\r
83 + notmuch restore < dump.expected &&
\r
84 + test_cmp dump-ABC_DEF.expected dump-simulate.actual'
\r
86 +test_subtest_known_broken
\r
87 +test_expect_success 'clear only matched tags' \
\r
88 + 'notmuch restore < dump-ABC_DEF.expected &&
\r
89 + notmuch restore --match="(ABC|DEF)" < clear.expected &&
\r
90 + notmuch dump > dump-clear-match.actual &&
\r
91 + notmuch restore < dump.expected &&
\r
92 + test_cmp dump.expected dump-clear-match.actual'
\r
94 +test_subtest_known_broken
\r
95 +test_expect_success 'import only matched tags' \
\r
96 + 'notmuch restore < dump.expected &&
\r
97 + notmuch restore --match="(inbox|unread)" < dump-ABC_DEF.expected &&
\r
98 + notmuch dump > dump-import-match.actual &&
\r
99 + notmuch restore < dump.expected &&
\r
100 + test_cmp dump.expected dump-import-match.actual'
\r
102 +sed 's/inbox\|unread\|signed\|ABC//g' < dump-ABC_DEF.expected > dump-DEF-only
\r
103 +sed 's/inbox\|unread\|signed\|DEF//g' < dump-ABC_DEF.expected > dump-ABC-only
\r
105 +test_subtest_known_broken
\r
106 +test_expect_success 'combine --match and --accumulate' \
\r
107 + 'notmuch restore < dump.expected &&
\r
108 + notmuch restore --match="(ABC|DEF)" < dump-ABC-only &&
\r
109 + notmuch restore --accumulate --match="(ABC|DEF)" < dump-DEF-only &&
\r
110 + notmuch dump > dump-combine-match.actual &&
\r
111 + notmuch restore < dump.expected &&
\r
112 + test_cmp dump-ABC_DEF.expected dump-combine-match.actual'
\r
114 test_begin_subtest "dump outfile"
\r
115 notmuch dump dump-outfile.actual
\r
116 test_expect_equal_file dump.expected dump-outfile.actual
\r