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 ED2A0431FAF for ; Sun, 19 Feb 2012 13:08:29 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 3c8Fa4tC9YKW for ; Sun, 19 Feb 2012 13:08:29 -0800 (PST) Received: from guru.guru-group.fi (guru-group.fi [87.108.86.66]) by olra.theworths.org (Postfix) with ESMTP id 5B1FB431FAE for ; Sun, 19 Feb 2012 13:08:29 -0800 (PST) Received: by guru.guru-group.fi (Postfix, from userid 501) id BA89C68055; Sun, 19 Feb 2012 23:08:30 +0200 (EET) From: Tomi Ollila To: Pieter Praet , Notmuch Mail Subject: Re: [PATCH v2 4/4] test: emacs: new test "notmuch-search: change tags of all matching messages" In-Reply-To: <1329683908-5435-5-git-send-email-pieter@praet.org> 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+198~g922c4d2 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Sun, 19 Feb 2012 21:08:30 -0000 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). [ ... ] Tomi