From: Pieter Praet Date: Thu, 23 Feb 2012 23:09:11 +0000 (+0100) Subject: [PATCH 3/6] test: emacs: `notmuch-show-tag-all' sans prefix arg should only tag open... X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=6f800c2418895a2f7a9859cbcc2b11e124288a66;p=notmuch-archives.git [PATCH 3/6] test: emacs: `notmuch-show-tag-all' sans prefix arg should only tag open messages --- diff --git a/ab/bed83344a3dc5daf0f36fea33a0ba4252c32e3 b/ab/bed83344a3dc5daf0f36fea33a0ba4252c32e3 new file mode 100644 index 000000000..0b78a8c3f --- /dev/null +++ b/ab/bed83344a3dc5daf0f36fea33a0ba4252c32e3 @@ -0,0 +1,114 @@ +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 23DE0431FD7 + for ; Thu, 23 Feb 2012 15:11:46 -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 lfgbYtVeFA85 for ; + Thu, 23 Feb 2012 15:11:44 -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 + A7614431FC2 for ; Thu, 23 Feb 2012 15:11:39 -0800 + (PST) +Received: by wgbdt12 with SMTP id dt12so1388960wgb.2 + for ; Thu, 23 Feb 2012 15:11:38 -0800 (PST) +Received-SPF: pass (google.com: domain of pieter@praet.org designates + 10.180.89.71 as permitted sender) client-ip=10.180.89.71; +Authentication-Results: mr.google.com; + spf=pass (google.com: domain of pieter@praet.org + designates 10.180.89.71 as permitted sender) + smtp.mail=pieter@praet.org +Received: from mr.google.com ([10.180.89.71]) + by 10.180.89.71 with SMTP id bm7mr730933wib.20.1330038698339 (num_hops + = 1); Thu, 23 Feb 2012 15:11:38 -0800 (PST) +MIME-Version: 1.0 +Received: by 10.180.89.71 with SMTP id bm7mr585606wib.20.1330038698150; + Thu, 23 Feb 2012 15:11:38 -0800 (PST) +Received: from localhost ([109.131.181.26]) + by mx.google.com with ESMTPS id gd8sm7406854wib.2.2012.02.23.15.11.37 + (version=TLSv1/SSLv3 cipher=OTHER); + Thu, 23 Feb 2012 15:11:37 -0800 (PST) +From: Pieter Praet +To: David Bremner , + Dmitry Kurochkin +Subject: [PATCH 3/6] test: emacs: `notmuch-show-tag-all' sans prefix arg + should only tag open messages +Date: Fri, 24 Feb 2012 00:09:11 +0100 +Message-Id: <1330038554-10347-3-git-send-email-pieter@praet.org> +X-Mailer: git-send-email 1.7.8.1 +In-Reply-To: <878vjtqhcg.fsf@praet.org> +References: <878vjtqhcg.fsf@praet.org> +X-Gm-Message-State: + ALoCoQnxVuDkAFYRLXroFAx/z1Fo5hYD+tMbFB4o/RTNMv0z56q9V2Tn8KfTo82i+xZwjlW0mN/g +Cc: Notmuch Mail +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: Thu, 23 Feb 2012 23:11:46 -0000 + +* test/emacs: + + - Alter subtest "notmuch-show: change tags of all messages in current buffer": + Pass a prefix arg to `notmuch-show-tag-all' ("*"). + + - New subtest "notmuch-show: change tags of open messages in current buffer": + When called *without* a prefix arg, `notmuch-show-tag-all' ("*") should only + change the tags of *open* messages. Currently broken, fix follows later. +--- + test/emacs | 18 +++++++++++++++++- + 1 files changed, 17 insertions(+), 1 deletions(-) + +diff --git a/test/emacs b/test/emacs +index d2dbafc..644ef59 100755 +--- a/test/emacs ++++ b/test/emacs +@@ -146,11 +146,27 @@ count_match=$(notmuch count -- "$query" AND "$filter") # = 2 + test_emacs "(notmuch-search \"$query AND $filter\") + (notmuch-test-wait) + (notmuch-search-show-thread) +- (execute-kbd-macro \"*+$add_tag -$del_tag\")" ++ (execute-kbd-macro \"*+$add_tag -$del_tag\")" + count_changed=$(notmuch count -- "$query" AND tag:"$add_tag" AND NOT tag:"$del_tag") + notmuch tag +"$del_tag" -"$add_tag" -- "$query" # revert tag changes + test_expect_equal "$count_changed" "$count_total" # assert that CHANGED == TOTAL + ++test_begin_subtest "notmuch-show: change tags of open messages in current buffer" ++test_subtest_known_broken ++query="$os_x_darwin_thread" ++filter="from:Jiang" ++add_tag="notmuch-show-tag-all" ++del_tag="inbox" ++count_total=$(notmuch count -- "$query") # = 4 ++count_match=$(notmuch count -- "$query" AND "$filter") # = 2 ++test_emacs "(notmuch-search \"$query AND $filter\") ++ (notmuch-test-wait) ++ (notmuch-search-show-thread) ++ (execute-kbd-macro \"*+$add_tag -$del_tag\")" ++count_changed=$(notmuch count -- "$query" AND tag:"$add_tag" AND NOT tag:"$del_tag") ++notmuch tag +"$del_tag" -"$add_tag" -- "$query" # revert tag changes ++test_expect_equal "$count_changed" "$count_match" # assert that CHANGED == MATCHING ++ + test_begin_subtest "Message with .. in Message-Id:" + add_message [id]=123..456@example '[subject]="Message with .. in Message-Id"' + test_emacs '(notmuch-search "id:\"123..456@example\"") +-- +1.7.8.1 +