[PATCH v2 2/6] test: emacs: new test "notmuch-show: change tags of all messages in current buffer"

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


* test/emacs:

  New subtest "notmuch-show: change tags of all messages in current buffer":
  `notmuch-show-tag-all' ("*") changes tags of *all* messages in current buffer.
---
 test/emacs |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/test/emacs b/test/emacs
index ec1dbb0..d2dbafc 100755
--- a/test/emacs
+++ b/test/emacs
@@ -136,6 +136,21 @@ test_emacs "(notmuch-show \"$os_x_darwin_thread\")
 output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)
 test_expect_equal "$output" "thread:XXX   2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)"
 
+test_begin_subtest "notmuch-show: change tags of all messages in current buffer"
+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_total" # assert that CHANGED == TOTAL
+
 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