1 Return-Path: <dmitry.kurochkin@gmail.com>
\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 AADE0431FB6
\r
6 for <notmuch@notmuchmail.org>; Mon, 20 Feb 2012 04:26:33 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id DTScGhMkz8ua for <notmuch@notmuchmail.org>;
\r
17 Mon, 20 Feb 2012 04:26:29 -0800 (PST)
\r
18 Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com
\r
19 [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 9FB52431FAF
\r
22 for <notmuch@notmuchmail.org>; Mon, 20 Feb 2012 04:26:29 -0800 (PST)
\r
23 Received: by bkcit16 with SMTP id it16so5126688bkc.26
\r
24 for <notmuch@notmuchmail.org>; Mon, 20 Feb 2012 04:26:28 -0800 (PST)
\r
25 Received-SPF: pass (google.com: domain of dmitry.kurochkin@gmail.com
\r
26 designates 10.205.124.15 as permitted sender)
\r
27 client-ip=10.205.124.15;
\r
28 Authentication-Results: mr.google.com; spf=pass (google.com: domain of
\r
29 dmitry.kurochkin@gmail.com designates 10.205.124.15 as
\r
30 permitted sender) smtp.mail=dmitry.kurochkin@gmail.com;
\r
31 dkim=pass header.i=dmitry.kurochkin@gmail.com
\r
32 Received: from mr.google.com ([10.205.124.15])
\r
33 by 10.205.124.15 with SMTP id gm15mr11232888bkc.63.1329740788314
\r
34 (num_hops = 1); Mon, 20 Feb 2012 04:26:28 -0800 (PST)
\r
35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
\r
36 h=from:to:subject:in-reply-to:references:user-agent:date:message-id
\r
37 :mime-version:content-type;
\r
38 bh=u3g6yl/GdPPbZQJXPYaO8ekHMK5bq6oKeMeJXNf5ir0=;
\r
39 b=LdzDYw3WPKOaEGGg5KbapuomNTVB89dc8Nl581vsLG+4dc93yCeO3Qmvehniy/o1at
\r
40 wliVyMUnVeusMjc6yJEX4dFAXmmNw1WUySkiqQR31D8kldvgB8vxt6nHv6Rz/JrmqGEb
\r
41 0tflBnmjnsFNk9JOsOAhLR3MH+GW0zHAeTvNQ=
\r
42 Received: by 10.205.124.15 with SMTP id gm15mr9059700bkc.63.1329740788242;
\r
43 Mon, 20 Feb 2012 04:26:28 -0800 (PST)
\r
44 Received: from localhost ([91.144.186.21])
\r
45 by mx.google.com with ESMTPS id ut6sm38802833bkb.14.2012.02.20.04.26.27
\r
46 (version=TLSv1/SSLv3 cipher=OTHER);
\r
47 Mon, 20 Feb 2012 04:26:27 -0800 (PST)
\r
48 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
\r
49 To: Pieter Praet <pieter@praet.org>, Notmuch Mail <notmuch@notmuchmail.org>
\r
50 Subject: Re: [PATCH v2 4/4] test: emacs: new test "notmuch-search: change tags
\r
51 of all matching messages"
\r
52 In-Reply-To: <1329683908-5435-5-git-send-email-pieter@praet.org>
\r
53 References: <1310313335-4159-1-git-send-email-pieter@praet.org>
\r
54 <1329683908-5435-1-git-send-email-pieter@praet.org>
\r
55 <1329683908-5435-5-git-send-email-pieter@praet.org>
\r
56 User-Agent: Notmuch/0.11.1+188~ga5674c2 (http://notmuchmail.org) Emacs/23.3.1
\r
57 (x86_64-pc-linux-gnu)
\r
58 Date: Mon, 20 Feb 2012 16:25:05 +0400
\r
59 Message-ID: <87linxlmji.fsf@gmail.com>
\r
61 Content-Type: text/plain; charset=us-ascii
\r
62 X-BeenThere: notmuch@notmuchmail.org
\r
63 X-Mailman-Version: 2.1.13
\r
65 List-Id: "Use and development of the notmuch mail system."
\r
66 <notmuch.notmuchmail.org>
\r
67 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
68 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
69 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
70 List-Post: <mailto:notmuch@notmuchmail.org>
\r
71 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
72 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
73 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
74 X-List-Received-Date: Mon, 20 Feb 2012 12:26:33 -0000
\r
76 On Sun, 19 Feb 2012 21:38:28 +0100, Pieter Praet <pieter@praet.org> wrote:
\r
77 > `notmuch-search-tag-all' (bound to "*") adds and removes tags
\r
78 > to/from all messages which match the query used to populate the
\r
79 > current search buffer.
\r
81 LGTM. But since you will need to send a new version to address Tomi's
\r
82 comments anyway, below are few minor comments.
\r
88 > test/emacs | 32 ++++++++++++++++++++++++++++++++
\r
89 > 1 files changed, 32 insertions(+), 0 deletions(-)
\r
91 > diff --git a/test/emacs b/test/emacs
\r
92 > index b0fb760..1db8540 100755
\r
95 > @@ -124,6 +124,38 @@ test_emacs "(notmuch-show \"$os_x_darwin_thread\")
\r
96 > output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)
\r
97 > 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
99 > +test_begin_subtest "notmuch-search: change tags of all matching messages"
\r
102 > +filter="AND from:cworth"
\r
103 > +# Get initial tag counts and prevent false positives/negatives
\r
104 > +old_tag_count_1=$(notmuch count tag:"${old_tag}" "${filter}")
\r
105 > +new_tag_count_1=$(notmuch count tag:"${new_tag}" "${filter}")
\r
106 > +test "${old_tag_count_1}" == "0" && old_tag_count_1="Need 1+ matches!"
\r
110 > +test "${new_tag_count_1}" == "0" || new_tag_count_1="Need 0 matches!"
\r
111 > +# Change tags of all matching messages and get tag counts
\r
112 > +test_emacs "(notmuch-search \"tag:${old_tag} ${filter}\")
\r
113 > + (notmuch-test-wait)
\r
114 > + (notmuch-search-tag-all \"-${old_tag}\" \"+${new_tag}\")"
\r
115 > +old_tag_count_2=$(notmuch count tag:"${old_tag}" "${filter}")
\r
116 > +new_tag_count_2=$(notmuch count tag:"${new_tag}" "${filter}")
\r
117 > +# Revert tag changes and get tag counts
\r
118 > +test_emacs "(notmuch-search \"tag:${new_tag} ${filter}\")
\r
119 > + (notmuch-test-wait)
\r
120 > + (notmuch-search-tag-all \"+${old_tag}\" \"-${new_tag}\")"
\r
121 > +old_tag_count_3=$(notmuch count tag:"${old_tag}" "${filter}")
\r
122 > +new_tag_count_3=$(notmuch count tag:"${new_tag}" "${filter}")
\r
123 > +# ... and verify the results
\r
125 > +before: old:${old_tag_count_1} new:${new_tag_count_1}
\r
126 > +after: old:${old_tag_count_2} new:${new_tag_count_2}
\r
127 > +restored: old:${old_tag_count_3} new:${new_tag_count_3}"
\r
129 > +before: old:${old_tag_count_1} new:0
\r
130 > +after: old:0 new:${old_tag_count_1}
\r
131 > +restored: old:${old_tag_count_1} new:0"
\r
132 > +test_expect_equal "$output" "$expected"
\r
135 I would add a newline before every commented block.
\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