[PATCH 6/8] CLI: refactor dumping of tags.
[notmuch-archives.git] / d6 / b703c0c9901128e607110a79312e45f2efa676
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 8D1C7429E42\r
6         for <notmuch@notmuchmail.org>; Mon, 10 Oct 2011 06:49:52 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -2.3\r
10 X-Spam-Level: \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 h52qAZpV9T1S for <notmuch@notmuchmail.org>;\r
16         Mon, 10 Oct 2011 06:49:51 -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 00C71429E32\r
21         for <notmuch@notmuchmail.org>; Mon, 10 Oct 2011 06:49:50 -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 p9ADnlo3010807\r
26         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);\r
27         Mon, 10 Oct 2011 10:49:48 -0300\r
28 Received: from bremner by zancas.localnet with local (Exim 4.76)\r
29         (envelope-from <bremner@tethera.net>)\r
30         id 1RDGEl-0006fo-C3; Mon, 10 Oct 2011 10:49:47 -0300\r
31 From: david@tethera.net\r
32 To: notmuch@notmuchmail.org\r
33 Subject: [PATCH 2/6] test: add tests for command line arguments to\r
34  notmuch-dump\r
35 Date: Mon, 10 Oct 2011 10:49:17 -0300\r
36 Message-Id: <1318254561-25386-3-git-send-email-david@tethera.net>\r
37 X-Mailer: git-send-email 1.7.6.3\r
38 In-Reply-To: <1318254561-25386-1-git-send-email-david@tethera.net>\r
39 References: <8739f2qhla.fsf@zancas.localnet>\r
40         <1318254561-25386-1-git-send-email-david@tethera.net>\r
41 Cc: David Bremner <bremner@debian.org>\r
42 X-BeenThere: notmuch@notmuchmail.org\r
43 X-Mailman-Version: 2.1.13\r
44 Precedence: list\r
45 List-Id: "Use and development of the notmuch mail system."\r
46         <notmuch.notmuchmail.org>\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
50 List-Post: <mailto:notmuch@notmuchmail.org>\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
54 X-List-Received-Date: Mon, 10 Oct 2011 13:49:52 -0000\r
55 \r
56 From: David Bremner <bremner@debian.org>\r
57 \r
58 The plan is to add the possibility of search terms after the file name,\r
59 and the use of -- to stop looking for an output file name.\r
60 ---\r
61  test/dump-restore |   28 ++++++++++++++++++++++++++++\r
62  1 files changed, 28 insertions(+), 0 deletions(-)\r
63 \r
64 diff --git a/test/dump-restore b/test/dump-restore\r
65 index 96c4f19..699337c 100755\r
66 --- a/test/dump-restore\r
67 +++ b/test/dump-restore\r
68 @@ -8,6 +8,34 @@ test_expect_success "Dumping all tags" "generate_message &&\r
69  notmuch new &&\r
70  notmuch dump > dump.expected"\r
71  \r
72 +test_begin_subtest "dump outfile"\r
73 +notmuch dump dump-outfile.actual\r
74 +test_expect_equal_file dump.expected dump-outfile.actual\r
75 +\r
76 +test_begin_subtest "dump outfile --"\r
77 +notmuch dump dump-1-arg-dash.actual\r
78 +test_expect_equal_file dump.expected dump-1-arg-dash.actual\r
79 +\r
80 +# Note, we assume all messages from cworth have a message-id\r
81 +# containing cworth.org\r
82 +\r
83 +grep cworth\.org dump.expected > dump-cworth.expected\r
84 +\r
85 +test_begin_subtest "dump -- from:cworth"\r
86 +test_subtest_known_broken\r
87 +notmuch dump -- from:cworth > dump-dash-cworth.actual\r
88 +test_expect_equal_file dump-cworth.expected dump-dash-cworth.actual\r
89 +\r
90 +test_begin_subtest "dump outfile from:cworth"\r
91 +test_subtest_known_broken\r
92 +notmuch dump dump-outfile-cworth.actual from:cworth\r
93 +test_expect_equal_file dump-cworth.expected dump-outfile-cworth.actual\r
94 +\r
95 +test_begin_subtest "dump outfile -- from:cworth"\r
96 +test_subtest_known_broken\r
97 +notmuch dump dump-outfile-dash-inbox.actual -- from:cworth\r
98 +test_expect_equal_file dump-cworth.expected dump-outfile-dash-inbox.actual\r
99 +\r
100  test_begin_subtest "Clearing all tags"\r
101  sed -e "s/(\([^(]*\))$/()/" < dump.expected > clear.expected\r
102  notmuch restore < clear.expected\r
103 -- \r
104 1.7.6.3\r
105 \r