[PATCH 3/6] test: emacs: `notmuch-show-tag-all' sans prefix arg should only tag open...
authorPieter Praet <pieter@praet.org>
Thu, 23 Feb 2012 23:09:11 +0000 (00:09 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:44:52 +0000 (09:44 -0800)
ab/bed83344a3dc5daf0f36fea33a0ba4252c32e3 [new file with mode: 0644]

diff --git a/ab/bed83344a3dc5daf0f36fea33a0ba4252c32e3 b/ab/bed83344a3dc5daf0f36fea33a0ba4252c32e3
new file mode 100644 (file)
index 0000000..0b78a8c
--- /dev/null
@@ -0,0 +1,114 @@
+Return-Path: <pieter@praet.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 23DE0431FD7\r
+       for <notmuch@notmuchmail.org>; Thu, 23 Feb 2012 15:11:46 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id lfgbYtVeFA85 for <notmuch@notmuchmail.org>;\r
+       Thu, 23 Feb 2012 15:11:44 -0800 (PST)\r
+Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com\r
+ [74.125.82.45])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ A7614431FC2   for <notmuch@notmuchmail.org>; Thu, 23 Feb 2012 15:11:39 -0800\r
+ (PST)\r
+Received: by wgbdt12 with SMTP id dt12so1388960wgb.2\r
+       for <notmuch@notmuchmail.org>; Thu, 23 Feb 2012 15:11:38 -0800 (PST)\r
+Received-SPF: pass (google.com: domain of pieter@praet.org designates\r
+       10.180.89.71 as permitted sender) client-ip=10.180.89.71; \r
+Authentication-Results: mr.google.com;\r
+       spf=pass (google.com: domain of pieter@praet.org\r
+       designates 10.180.89.71 as permitted sender)\r
+       smtp.mail=pieter@praet.org\r
+Received: from mr.google.com ([10.180.89.71])\r
+       by 10.180.89.71 with SMTP id bm7mr730933wib.20.1330038698339 (num_hops\r
+       = 1); Thu, 23 Feb 2012 15:11:38 -0800 (PST)\r
+MIME-Version: 1.0\r
+Received: by 10.180.89.71 with SMTP id bm7mr585606wib.20.1330038698150;\r
+       Thu, 23 Feb 2012 15:11:38 -0800 (PST)\r
+Received: from localhost ([109.131.181.26])\r
+       by mx.google.com with ESMTPS id gd8sm7406854wib.2.2012.02.23.15.11.37\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Thu, 23 Feb 2012 15:11:37 -0800 (PST)\r
+From: Pieter Praet <pieter@praet.org>\r
+To: David Bremner <david@tethera.net>,\r
+       Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+Subject: [PATCH 3/6] test: emacs: `notmuch-show-tag-all' sans prefix arg\r
+       should only tag open messages\r
+Date: Fri, 24 Feb 2012 00:09:11 +0100\r
+Message-Id: <1330038554-10347-3-git-send-email-pieter@praet.org>\r
+X-Mailer: git-send-email 1.7.8.1\r
+In-Reply-To: <878vjtqhcg.fsf@praet.org>\r
+References: <878vjtqhcg.fsf@praet.org>\r
+X-Gm-Message-State:\r
+ ALoCoQnxVuDkAFYRLXroFAx/z1Fo5hYD+tMbFB4o/RTNMv0z56q9V2Tn8KfTo82i+xZwjlW0mN/g\r
+Cc: Notmuch Mail <notmuch@notmuchmail.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 23 Feb 2012 23:11:46 -0000\r
+\r
+* test/emacs:\r
+\r
+  - Alter subtest "notmuch-show: change tags of all messages in current buffer":\r
+    Pass a prefix arg to `notmuch-show-tag-all' ("*").\r
+\r
+  - New subtest "notmuch-show: change tags of open messages in current buffer":\r
+    When called *without* a prefix arg, `notmuch-show-tag-all' ("*") should only\r
+    change the tags of *open* messages.  Currently broken, fix follows later.\r
+---\r
+ test/emacs |   18 +++++++++++++++++-\r
+ 1 files changed, 17 insertions(+), 1 deletions(-)\r
+\r
+diff --git a/test/emacs b/test/emacs\r
+index d2dbafc..644ef59 100755\r
+--- a/test/emacs\r
++++ b/test/emacs\r
+@@ -146,11 +146,27 @@ count_match=$(notmuch count -- "$query" AND "$filter") # = 2\r
+ test_emacs "(notmuch-search \"$query AND $filter\")\r
+         (notmuch-test-wait)\r
+         (notmuch-search-show-thread)\r
+-        (execute-kbd-macro \"*+$add_tag -$del_tag\")"\r
++        (execute-kbd-macro \"\15*+$add_tag -$del_tag\")"\r
+ count_changed=$(notmuch count -- "$query" AND tag:"$add_tag" AND NOT tag:"$del_tag")\r
+ notmuch tag +"$del_tag" -"$add_tag" -- "$query" # revert tag changes\r
+ test_expect_equal "$count_changed" "$count_total" # assert that CHANGED == TOTAL\r
\r
++test_begin_subtest "notmuch-show: change tags of open messages in current buffer"\r
++test_subtest_known_broken\r
++query="$os_x_darwin_thread"\r
++filter="from:Jiang"\r
++add_tag="notmuch-show-tag-all"\r
++del_tag="inbox"\r
++count_total=$(notmuch count -- "$query")               # = 4\r
++count_match=$(notmuch count -- "$query" AND "$filter") # = 2\r
++test_emacs "(notmuch-search \"$query AND $filter\")\r
++        (notmuch-test-wait)\r
++        (notmuch-search-show-thread)\r
++        (execute-kbd-macro \"*+$add_tag -$del_tag\")"\r
++count_changed=$(notmuch count -- "$query" AND tag:"$add_tag" AND NOT tag:"$del_tag")\r
++notmuch tag +"$del_tag" -"$add_tag" -- "$query" # revert tag changes\r
++test_expect_equal "$count_changed" "$count_match" # assert that CHANGED == MATCHING\r
++\r
+ test_begin_subtest "Message with .. in Message-Id:"\r
+ add_message [id]=123..456@example '[subject]="Message with .. in Message-Id"'\r
+ test_emacs '(notmuch-search "id:\"123..456@example\"")\r
+-- \r
+1.7.8.1\r
+\r