[PATCH v2 3/6] test: emacs: `notmuch-show-tag-all' with prefix arg should only tag open messages

Pieter Praet pieter at praet.org
Fri Feb 24 14:30:37 PST 2012


* test/emacs:

  - New subtest "notmuch-show: change tags of open messages in current buffer":
    When called with a prefix arg, `notmuch-show-tag-all' ("*") should only
    change the tags of *open* messages.  Currently broken, fix follows later.
---
 test/emacs |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/test/emacs b/test/emacs
index d2dbafc..9088ced 100755
--- a/test/emacs
+++ b/test/emacs
@@ -151,6 +151,22 @@ count_changed=$(notmuch count -- "$query" AND tag:"$add_tag" AND NOT tag:"$del_t
 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 at example '[subject]="Message with .. in Message-Id"'
 test_emacs '(notmuch-search "id:\"123..456 at example\"")
-- 
1.7.8.1



More information about the notmuch mailing list