1 Return-Path: <bremner@pivot.cs.unb.ca>
\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 51A4C431FD0
\r
6 for <notmuch@notmuchmail.org>; Fri, 21 Oct 2011 12:48:14 -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 zOxfEoFxlJEt for <notmuch@notmuchmail.org>;
\r
16 Fri, 21 Oct 2011 12:48:12 -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 63406429E29
\r
21 for <notmuch@notmuchmail.org>; Fri, 21 Oct 2011 12:48:11 -0700 (PDT)
\r
22 Received: from convex-new.cs.unb.ca ([131.202.13.154])
\r
23 by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id p9LJm42D002201;
\r
24 Fri, 21 Oct 2011 16:48:07 -0300
\r
25 Received: from bremner by convex-new.cs.unb.ca with local (Exim 4.72)
\r
26 (envelope-from <bremner@pivot.cs.unb.ca>)
\r
27 id 1RHL4W-00016O-Qe; Fri, 21 Oct 2011 16:48:04 -0300
\r
28 From: David Bremner <david@tethera.net>
\r
29 To: notmuch@notmuchmail.org
\r
30 Subject: [PATCH 2/6] test/dump-restore: expand test suite for dump-restore,
\r
32 Date: Fri, 21 Oct 2011 16:47:53 -0300
\r
33 Message-Id: <1319226477-4181-3-git-send-email-david@tethera.net>
\r
34 X-Mailer: git-send-email 1.7.5.4
\r
35 In-Reply-To: <1319226477-4181-1-git-send-email-david@tethera.net>
\r
36 References: <1317317857-29636-1-git-send-email-thomas@schwinge.name>
\r
37 <1319226477-4181-1-git-send-email-david@tethera.net>
\r
38 Cc: David Bremner <bremner@debian.org>
\r
39 X-BeenThere: notmuch@notmuchmail.org
\r
40 X-Mailman-Version: 2.1.13
\r
42 List-Id: "Use and development of the notmuch mail system."
\r
43 <notmuch.notmuchmail.org>
\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
45 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
47 List-Post: <mailto:notmuch@notmuchmail.org>
\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
50 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
51 X-List-Received-Date: Fri, 21 Oct 2011 19:48:14 -0000
\r
53 From: David Bremner <bremner@debian.org>
\r
55 Several new tests are added, and existing use of test_begin_subtest is
\r
56 replaced by test_expect_success to catch failing commands in cases where
\r
57 we execute more than one command.
\r
61 id:"1317317811-29540-1-git-send-email-thomas@schwinge.name"
\r
63 test/dump-restore | 41 +++++++++++++++++++++++++----------------
\r
64 1 files changed, 25 insertions(+), 16 deletions(-)
\r
66 diff --git a/test/dump-restore b/test/dump-restore
\r
67 index de85693..502fb82 100755
\r
68 --- a/test/dump-restore
\r
69 +++ b/test/dump-restore
\r
70 @@ -4,9 +4,31 @@ test_description="\"notmuch dump\" and \"notmuch restore\""
\r
74 -test_expect_success "Dumping all tags" "generate_message &&
\r
76 -notmuch dump > dump.expected"
\r
77 +test_expect_success 'Dumping all tags' \
\r
78 + 'generate_message &&
\r
80 + notmuch dump > dump.expected'
\r
82 +test_expect_success 'Clearing all tags' \
\r
83 + 'sed -e "s/(\([^(]*\))$/()/" < dump.expected > clear.expected &&
\r
84 + notmuch restore clear.expected &&
\r
85 + notmuch dump > clear.actual &&
\r
86 + test_cmp clear.expected clear.actual'
\r
88 +test_expect_success 'Restoring original tags' \
\r
89 + 'notmuch restore dump.expected &&
\r
90 + notmuch dump > dump.actual &&
\r
91 + test_cmp dump.expected dump.actual'
\r
93 +test_expect_success 'Restore with nothing to do' \
\r
94 + 'notmuch restore < dump.expected &&
\r
95 + notmuch dump > dump.actual &&
\r
96 + test_cmp dump.expected dump.actual'
\r
98 +# notmuch restore currently only considers the first argument.
\r
99 +test_subtest_known_broken
\r
100 +test_expect_success 'Invalid restore invocation' \
\r
101 + 'test_must_fail notmuch restore dump.expected another_one'
\r
103 test_begin_subtest "dump outfile"
\r
104 notmuch dump dump-outfile.actual
\r
105 @@ -37,17 +59,4 @@ test_begin_subtest "dump outfile -- from:cworth"
\r
106 notmuch dump dump-outfile-dash-inbox.actual -- from:cworth
\r
107 test_expect_equal_file dump-cworth.expected dump-outfile-dash-inbox.actual
\r
109 -test_begin_subtest "Clearing all tags"
\r
110 -sed -e "s/(\([^(]*\))$/()/" < dump.expected > clear.expected
\r
111 -notmuch restore < clear.expected
\r
112 -notmuch dump > clear.actual
\r
113 -test_expect_equal "$(< clear.actual)" "$(< clear.expected)"
\r
115 -test_begin_subtest "Restoring original tags"
\r
116 -notmuch restore < dump.expected
\r
117 -notmuch dump > dump.actual
\r
118 -test_expect_equal "$(< dump.actual)" "$(< dump.expected)"
\r
120 -test_expect_success "Restore with nothing to do" "notmuch restore dump.expected"
\r