Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / 1e / e4734e45f678b0658d47f687d1bd8e3dc9b3ca
1 Return-Path: <pieter@praet.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 4EE5E431FAE\r
6         for <notmuch@notmuchmail.org>; Wed, 22 Feb 2012 10:56:15 -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 5D0L2sRMbegM for <notmuch@notmuchmail.org>;\r
16         Wed, 22 Feb 2012 10:56:14 -0800 (PST)\r
17 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
18         [209.85.212.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 1A78A431FBD\r
21         for <notmuch@notmuchmail.org>; Wed, 22 Feb 2012 10:56:13 -0800 (PST)\r
22 Received: by wibhi8 with SMTP id hi8so278196wib.26\r
23         for <notmuch@notmuchmail.org>; Wed, 22 Feb 2012 10:56:13 -0800 (PST)\r
24 Received-SPF: pass (google.com: domain of pieter@praet.org designates\r
25         10.180.101.37 as permitted sender) client-ip=10.180.101.37; \r
26 Authentication-Results: mr.google.com;\r
27         spf=pass (google.com: domain of pieter@praet.org\r
28         designates 10.180.101.37 as permitted sender)\r
29         smtp.mail=pieter@praet.org\r
30 Received: from mr.google.com ([10.180.101.37])\r
31         by 10.180.101.37 with SMTP id fd5mr43888104wib.1.1329936973164\r
32         (num_hops = 1); Wed, 22 Feb 2012 10:56:13 -0800 (PST)\r
33 Received: by 10.180.101.37 with SMTP id fd5mr36322257wib.1.1329936973107;\r
34         Wed, 22 Feb 2012 10:56:13 -0800 (PST)\r
35 Received: from localhost ([109.131.181.26])\r
36         by mx.google.com with ESMTPS id ga1sm74964741wib.5.2012.02.22.10.56.12\r
37         (version=TLSv1/SSLv3 cipher=OTHER);\r
38         Wed, 22 Feb 2012 10:56:12 -0800 (PST)\r
39 From: Pieter Praet <pieter@praet.org>\r
40 To: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>,\r
41         Notmuch Mail <notmuch@notmuchmail.org>\r
42 Subject: Re: [PATCH v2 4/4] test: emacs: new test "notmuch-search: change tags\r
43         of all matching messages"\r
44 In-Reply-To: <87linxlmji.fsf@gmail.com>\r
45 References: <1310313335-4159-1-git-send-email-pieter@praet.org>\r
46         <1329683908-5435-1-git-send-email-pieter@praet.org>\r
47         <1329683908-5435-5-git-send-email-pieter@praet.org>\r
48         <87linxlmji.fsf@gmail.com>\r
49 User-Agent: Notmuch/0.11.1+210~g6afc43e (http://notmuchmail.org) Emacs/23.3.1\r
50         (x86_64-unknown-linux-gnu)\r
51 Date: Wed, 22 Feb 2012 19:53:55 +0100\r
52 Message-ID: <87booq8zss.fsf@praet.org>\r
53 MIME-Version: 1.0\r
54 Content-Type: text/plain; charset=us-ascii\r
55 X-Gm-Message-State:\r
56  ALoCoQlPIH3A1lL2H1dPzkjkCyn5kutDth/ad87X3j29IDLPW3PgOfhtsyApty6zN0KWrGvDt6DP\r
57 X-BeenThere: notmuch@notmuchmail.org\r
58 X-Mailman-Version: 2.1.13\r
59 Precedence: list\r
60 List-Id: "Use and development of the notmuch mail system."\r
61         <notmuch.notmuchmail.org>\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
65 List-Post: <mailto:notmuch@notmuchmail.org>\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
68         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
69 X-List-Received-Date: Wed, 22 Feb 2012 18:56:15 -0000\r
70 \r
71 On Mon, 20 Feb 2012 16:25:05 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:\r
72 > On Sun, 19 Feb 2012 21:38:28 +0100, Pieter Praet <pieter@praet.org> wrote:\r
73 > > `notmuch-search-tag-all' (bound to "*") adds and removes tags\r
74 > > to/from all messages which match the query used to populate the\r
75 > > current search buffer.\r
76\r
77 > LGTM.  But since you will need to send a new version to address Tomi's\r
78 > comments anyway, below are few minor comments.\r
79\r
80 > Regards,\r
81 >   Dmitry\r
82\r
83 > > ---\r
84 > >  test/emacs |   32 ++++++++++++++++++++++++++++++++\r
85 > >  1 files changed, 32 insertions(+), 0 deletions(-)\r
86 > > \r
87 > > diff --git a/test/emacs b/test/emacs\r
88 > > index b0fb760..1db8540 100755\r
89 > > --- a/test/emacs\r
90 > > +++ b/test/emacs\r
91 > > @@ -124,6 +124,38 @@ test_emacs "(notmuch-show \"$os_x_darwin_thread\")\r
92 > >  output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)\r
93 > >  test_expect_equal "$output" "thread:XXX   2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)"\r
94 > >  \r
95 > > +test_begin_subtest "notmuch-search: change tags of all matching messages"\r
96 > > +old_tag="inbox"\r
97 > > +new_tag="xobni"\r
98 > > +filter="AND from:cworth"\r
99 > > +# Get initial tag counts and prevent false positives/negatives\r
100 > > +old_tag_count_1=$(notmuch count tag:"${old_tag}" "${filter}")\r
101 > > +new_tag_count_1=$(notmuch count tag:"${new_tag}" "${filter}")\r
102 > > +test "${old_tag_count_1}" == "0" && old_tag_count_1="Need 1+ matches!"\r
103\r
104 > Consider s/1+/>0/.\r
105\r
106 > > +test "${new_tag_count_1}" == "0" || new_tag_count_1="Need 0 matches!"\r
107 > > +# Change tags of all matching messages and get tag counts\r
108 > > +test_emacs "(notmuch-search \"tag:${old_tag} ${filter}\")\r
109 > > +       (notmuch-test-wait)\r
110 > > +       (notmuch-search-tag-all \"-${old_tag}\" \"+${new_tag}\")"\r
111 > > +old_tag_count_2=$(notmuch count tag:"${old_tag}" "${filter}")\r
112 > > +new_tag_count_2=$(notmuch count tag:"${new_tag}" "${filter}")\r
113 > > +# Revert tag changes and get tag counts\r
114 > > +test_emacs "(notmuch-search \"tag:${new_tag} ${filter}\")\r
115 > > +       (notmuch-test-wait)\r
116 > > +       (notmuch-search-tag-all \"+${old_tag}\" \"-${new_tag}\")"\r
117 > > +old_tag_count_3=$(notmuch count tag:"${old_tag}" "${filter}")\r
118 > > +new_tag_count_3=$(notmuch count tag:"${new_tag}" "${filter}")\r
119 > > +# ... and verify the results\r
120 > > +output="\r
121 > > +before:   old:${old_tag_count_1} new:${new_tag_count_1}\r
122 > > +after:    old:${old_tag_count_2} new:${new_tag_count_2}\r
123 > > +restored: old:${old_tag_count_3} new:${new_tag_count_3}"\r
124 > > +expected="\r
125 > > +before:   old:${old_tag_count_1} new:0\r
126 > > +after:    old:0 new:${old_tag_count_1}\r
127 > > +restored: old:${old_tag_count_1} new:0"\r
128 > > +test_expect_equal "$output" "$expected"\r
129 > > +\r
130\r
131 > I would add a newline before every commented block.\r
132 >\r
133 \r
134 Agreed, on all accounts.\r
135 \r
136 \r
137 > Regards,\r
138 >   Dmitry\r
139\r
140 > >  test_begin_subtest "Message with .. in Message-Id:"\r
141 > >  add_message [id]=123..456@example '[subject]="Message with .. in Message-Id"'\r
142 > >  test_emacs '(notmuch-search "id:\"123..456@example\"")\r
143 > > -- \r
144 > > 1.7.8.1\r
145 > > \r
146 \r
147 \r
148 Peace\r
149 \r
150 -- \r
151 Pieter\r