[PATCH 1/2] notmuch-emacs-mua: use message-add-actions
[notmuch-archives.git] / ea / 7a916e93a7c5776251a7c0d5f86b7a25b1abf0
1 Return-Path: <jani@nikula.org>\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 AA96D431FAE\r
6         for <notmuch@notmuchmail.org>; Mon, 10 Dec 2012 13:31:52 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 7C1Abyn54Iks for <notmuch@notmuchmail.org>;\r
16         Mon, 10 Dec 2012 13:31:52 -0800 (PST)\r
17 Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com\r
18         [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id CA480431FAF\r
21         for <notmuch@notmuchmail.org>; Mon, 10 Dec 2012 13:31:51 -0800 (PST)\r
22 Received: by mail-lb0-f181.google.com with SMTP id ge1so2519615lbb.26\r
23         for <notmuch@notmuchmail.org>; Mon, 10 Dec 2012 13:31:50 -0800 (PST)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=google.com; s=20120113;\r
26         h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
27         :mime-version:content-type:x-gm-message-state;\r
28         bh=RQmCtEZSIcxD+vxLUFVUVJPRUfqYYro/3VpyA8iKXkU=;\r
29         b=X6csyaxGbLVyOatjIJSSKJ4Gh1yXI3aBZW3slDh0R/6pmKL/JFyvGmkZWVYbRbeluk\r
30         +X4GX0+Gcfrr9ka4HrhjDlm/tiDqBZtDYznJoBqtJgx7RXE7zxHp63P2uElerAWvV7ip\r
31         thi1XaojCJNZ1bzdNczR3zs/Doq9IlRzILutk5RRTcRD4Ob+LNSWQZLzEIAyEEMCKuPI\r
32         oMAUL5BTPNN89A5hlXmFA4l7/CXbLsasWlf8Vhod6cDtofz/ZEtG/tzLMMXkqO5GQ5Ws\r
33         tM6UaglShtOJb2OsCD67RRe81AtL27Bc1R6Gf4CQMPffBNUaMIzxZqXBj3dDtqPJX/Lv\r
34         WDHw==\r
35 Received: by 10.152.135.139 with SMTP id ps11mr15120000lab.29.1355175110300;\r
36         Mon, 10 Dec 2012 13:31:50 -0800 (PST)\r
37 Received: from localhost (dsl-hkibrasgw4-fe51df00-27.dhcp.inet.fi.\r
38         [80.223.81.27])\r
39         by mx.google.com with ESMTPS id bf3sm8422583lbb.16.2012.12.10.13.31.47\r
40         (version=SSLv3 cipher=OTHER); Mon, 10 Dec 2012 13:31:48 -0800 (PST)\r
41 From: Jani Nikula <jani@nikula.org>\r
42 To: david@tethera.net, notmuch@notmuchmail.org\r
43 Subject: Re: [Patch v6 4/6] test: add test for notmuch tag --batch option\r
44 In-Reply-To: <1355096008-4544-5-git-send-email-david@tethera.net>\r
45 References: <1355096008-4544-1-git-send-email-david@tethera.net>\r
46         <1355096008-4544-5-git-send-email-david@tethera.net>\r
47 User-Agent: Notmuch/0.14+138~g7041c56 (http://notmuchmail.org) Emacs/23.4.1\r
48         (i686-pc-linux-gnu)\r
49 Date: Mon, 10 Dec 2012 23:31:46 +0200\r
50 Message-ID: <87ehixa919.fsf@nikula.org>\r
51 MIME-Version: 1.0\r
52 Content-Type: text/plain; charset=us-ascii\r
53 X-Gm-Message-State:\r
54  ALoCoQnLfH9Ahfc/DjlxNWaKNFTeitiE95NOU0H1bpYWoV7yoEoyzXR33X7fQng7wxk+xSt0NZbV\r
55 X-BeenThere: notmuch@notmuchmail.org\r
56 X-Mailman-Version: 2.1.13\r
57 Precedence: list\r
58 List-Id: "Use and development of the notmuch mail system."\r
59         <notmuch.notmuchmail.org>\r
60 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
62 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
63 List-Post: <mailto:notmuch@notmuchmail.org>\r
64 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
65 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
66         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
67 X-List-Received-Date: Mon, 10 Dec 2012 21:31:52 -0000\r
68 \r
69 On Mon, 10 Dec 2012, david@tethera.net wrote:\r
70 > From: Jani Nikula <jani@nikula.org>\r
71 >\r
72 > Basic test of functionality, along with all combinations of options.\r
73 >\r
74 > Modified extensively by David Bremner <david@tethera.net>\r
75 >\r
76 > The choice of @ as a tag is intended to be non-alphanumeric, but still\r
77 > not too much trouble in the shell and in the old sup dump/restore format.\r
78 \r
79 LGTM.\r
80 \r
81 > ---\r
82 >  test/tagging |   51 +++++++++++++++++++++++++++++++++++++++++++++++++++\r
83 >  1 file changed, 51 insertions(+)\r
84 >\r
85 > diff --git a/test/tagging b/test/tagging\r
86 > index 980ff92..0f3d797 100755\r
87 > --- a/test/tagging\r
88 > +++ b/test/tagging\r
89 > @@ -46,6 +46,57 @@ test_expect_equal "$output" "\\r
90 >  thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; One (:\"  inbox tag1 unread)\r
91 >  thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag1 tag4 unread)"\r
92 >  \r
93 > +test_begin_subtest "--batch"\r
94 > +notmuch tag --batch <<EOF\r
95 > +# %20 is a space in tag\r
96 > +-:"%20 -tag1 +tag5 +tag6 -- One\r
97 > ++tag1 -tag1 -tag4 +tag4 -- Two\r
98 > +-tag6 One\r
99 > ++tag5 Two\r
100 > +EOF\r
101 > +output=$(notmuch search \* | notmuch_search_sanitize)\r
102 > +test_expect_equal "$output" "\\r
103 > +thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; One (inbox tag5 unread)\r
104 > +thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag4 tag5 unread)"\r
105 > +\r
106 > +# generate a common input file for the next several tests.\r
107 > +cat > batch.in  <<EOF\r
108 > +# %40 is an @ in tag\r
109 > ++%40 -tag5 +tag6 -- One\r
110 > ++tag1 -tag1 -tag4 +tag4 -- Two\r
111 > +-tag5 +tag6 Two\r
112 > +EOF\r
113 > +\r
114 > +cat > batch.expected <<EOF\r
115 > +thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; One (@ inbox tag6 unread)\r
116 > +thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag4 tag6 unread)\r
117 > +EOF\r
118 > +\r
119 > +test_begin_subtest "--input"\r
120 > +notmuch dump --format=batch-tag > backup.tags\r
121 > +notmuch tag --input=batch.in\r
122 > +notmuch search \* | notmuch_search_sanitize > OUTPUT.$test_count\r
123 > +notmuch restore --format=batch-tag < backup.tags\r
124 > +test_expect_equal_file batch.expected OUTPUT.$test_count\r
125 > +\r
126 > +test_begin_subtest "--batch --input"\r
127 > +notmuch dump --format=batch-tag > backup.tags\r
128 > +notmuch tag --batch --input=batch.in\r
129 > +notmuch search \* | notmuch_search_sanitize > OUTPUT.$test_count\r
130 > +notmuch restore --format=batch-tag < backup.tags\r
131 > +test_expect_equal_file batch.expected OUTPUT.$test_count\r
132 > +\r
133 > +test_begin_subtest "--batch, blank lines and comments"\r
134 > +notmuch dump | sort > EXPECTED.$test_count\r
135 > +notmuch tag --batch <<EOF\r
136 > +# this line is a comment; the next has only white space\r
137 > +      \r
138 > +\r
139 > +# the previous line is empty\r
140 > +EOF\r
141 > +notmuch dump | sort > OUTPUT.$test_count\r
142 > +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count\r
143 > +\r
144 >  test_expect_code 1 "Empty tag names" 'notmuch tag + One'\r
145 >  \r
146 >  test_expect_code 1 "Tag name beginning with -" 'notmuch tag +- One'\r
147 > -- \r
148 > 1.7.10.4\r