From 7d2c70941ad8e44c8dc9f83c498a7f9972ef6702 Mon Sep 17 00:00:00 2001 From: Pieter Praet Date: Wed, 22 Feb 2012 19:53:20 +0100 Subject: [PATCH] Re: [PATCH v2 4/4] test: emacs: new test "notmuch-search: change tags of all matching messages" --- 1d/8a96b3045b0c978fb449e44b0ea2fbc9b71588 | 104 ++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 1d/8a96b3045b0c978fb449e44b0ea2fbc9b71588 diff --git a/1d/8a96b3045b0c978fb449e44b0ea2fbc9b71588 b/1d/8a96b3045b0c978fb449e44b0ea2fbc9b71588 new file mode 100644 index 000000000..87166406b --- /dev/null +++ b/1d/8a96b3045b0c978fb449e44b0ea2fbc9b71588 @@ -0,0 +1,104 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 23307431FB6 + for ; Wed, 22 Feb 2012 10:55:35 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id S7w55-RCjwpO for ; + Wed, 22 Feb 2012 10:55:34 -0800 (PST) +Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com + [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 689C6431FAE for ; Wed, 22 Feb 2012 10:55:34 -0800 + (PST) +Received: by wgbdt12 with SMTP id dt12so318948wgb.2 + for ; Wed, 22 Feb 2012 10:55:33 -0800 (PST) +Received-SPF: pass (google.com: domain of pieter@praet.org designates + 10.180.87.8 as permitted sender) client-ip=10.180.87.8; +Authentication-Results: mr.google.com; + spf=pass (google.com: domain of pieter@praet.org + designates 10.180.87.8 as permitted sender) + smtp.mail=pieter@praet.org +Received: from mr.google.com ([10.180.87.8]) + by 10.180.87.8 with SMTP id t8mr39272699wiz.15.1329936933295 (num_hops + = 1); Wed, 22 Feb 2012 10:55:33 -0800 (PST) +Received: by 10.180.87.8 with SMTP id t8mr32595739wiz.15.1329936933127; + Wed, 22 Feb 2012 10:55:33 -0800 (PST) +Received: from localhost ([109.131.181.26]) + by mx.google.com with ESMTPS id fl2sm74969282wib.4.2012.02.22.10.55.32 + (version=TLSv1/SSLv3 cipher=OTHER); + Wed, 22 Feb 2012 10:55:32 -0800 (PST) +From: Pieter Praet +To: Tomi Ollila , Notmuch Mail +Subject: Re: [PATCH v2 4/4] test: emacs: new test "notmuch-search: change tags + of all matching messages" +In-Reply-To: +References: <1310313335-4159-1-git-send-email-pieter@praet.org> + <1329683908-5435-1-git-send-email-pieter@praet.org> + <1329683908-5435-5-git-send-email-pieter@praet.org> + +User-Agent: Notmuch/0.11.1+210~g6afc43e (http://notmuchmail.org) Emacs/23.3.1 + (x86_64-unknown-linux-gnu) +Date: Wed, 22 Feb 2012 19:53:20 +0100 +Message-ID: <87ehtm8ztr.fsf@praet.org> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Gm-Message-State: + ALoCoQmgrNyZPWaew6l6ia9kRZybHLIz2f2MFpD8lR7wPbQD2maESNp8Fl9r0OlQHc+rHINZA7fi +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 22 Feb 2012 18:55:35 -0000 + +On Sun, 19 Feb 2012 23:08:30 +0200, Tomi Ollila wrote: +> On Sun, 19 Feb 2012 21:38:28 +0100, Pieter Praet wrote: +> > `notmuch-search-tag-all' (bound to "*") adds and removes tags +> > to/from all messages which match the query used to populate the +> > current search buffer. +> > --- +> > test/emacs | 32 ++++++++++++++++++++++++++++++++ +> > 1 files changed, 32 insertions(+), 0 deletions(-) +> > +> +> [ ... ] +> +> > +old_tag_count_1=$(notmuch count tag:"${old_tag}" "${filter}") +> > +new_tag_count_1=$(notmuch count tag:"${new_tag}" "${filter}") +> > +test "${old_tag_count_1}" == "0" && old_tag_count_1="Need 1+ matches!" +> > +test "${new_tag_count_1}" == "0" || new_tag_count_1="Need 0 matches!" +> > +# Change tags of all matching messages and get tag counts +> > +test_emacs "(notmuch-search \"tag:${old_tag} ${filter}\") +> +> Small nit: string equality comparison operator is '='. +> Use grep '==' test/* to confirm (or man test). +> + +Argh... Nice catch! + + +> [ ... ] +> +> Tomi + + +Peace + +-- +Pieter -- 2.26.2