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

Pieter Praet pieter at praet.org
Thu Feb 23 15:09:11 PST 2012


* 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 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