unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Mark Walters <markwalters1009@gmail.com>
To: notmuch@notmuchmail.org
Subject: [Patch v7 03/13] test: add tests for new cli --no-exclude option
Date: Thu,  1 Mar 2012 22:30:35 +0000	[thread overview]
Message-ID: <1330641045-27416-4-git-send-email-markwalters1009@gmail.com> (raw)
In-Reply-To: <1330641045-27416-1-git-send-email-markwalters1009@gmail.com>

The tests test the new --no-exclude option to search and count.
There were no existing tests for the exclude behaviour for count so
added these too.
---
 test/count  |   21 +++++++++++++++++++++
 test/search |    5 +++++
 2 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/test/count b/test/count
index 300b171..976fff1 100755
--- a/test/count
+++ b/test/count
@@ -37,4 +37,25 @@ test_expect_equal \
     "0" \
     "`notmuch count --output=threads ${SEARCH}`"
 
+test_begin_subtest "count excluding \"deleted\" messages"
+notmuch config set search.exclude_tags = deleted
+generate_message '[subject]="Not deleted"'
+generate_message '[subject]="Another not deleted"'
+generate_message '[subject]="Deleted"'
+notmuch new > /dev/null
+notmuch tag +deleted id:$gen_msg_id
+test_expect_equal \
+    "2" \
+    "`notmuch count subject:deleted`"
+
+test_begin_subtest "count \"deleted\" messages, exclude overridden"
+test_expect_equal \
+    "1" \
+    "`notmuch count subject:deleted and tag:deleted`"
+
+test_begin_subtest "count \"deleted\" messages, with --no-exclude"
+test_expect_equal \
+    "3" \
+    "`notmuch count --no-exclude subject:deleted`"
+
 test_done
diff --git a/test/search b/test/search
index 414be35..3da5d17 100755
--- a/test/search
+++ b/test/search
@@ -148,6 +148,11 @@ output=$(notmuch search subject:deleted | notmuch_search_sanitize)
 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread)
 thread:XXX   2001-01-05 [1/2] Notmuch Test Suite; Not deleted reply (deleted inbox unread)"
 
+test_begin_subtest "Don't exclude \"deleted\" messages when --no-exclude specified"
+output=$(notmuch search --no-exclude subject:deleted | notmuch_search_sanitize)
+test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread)
+thread:XXX   2001-01-05 [2/2] Notmuch Test Suite; Deleted (deleted inbox unread)"
+
 test_begin_subtest "Don't exclude \"deleted\" messages from search if not configured"
 notmuch config set search.exclude_tags
 output=$(notmuch search subject:deleted | notmuch_search_sanitize)
-- 
1.7.2.3

  parent reply	other threads:[~2012-03-01 22:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-01 22:30 [Patch v7 00/13] Add NOTMUCH_MESSAGE_FLAG_EXCLUDED flag Mark Walters
2012-03-01 22:30 ` [Patch v7 01/13] cli: add --no-exclude option to count and search Mark Walters
2012-03-01 22:30 ` [Patch v7 02/13] cli: Add --no-exclude to the man pages for search and count Mark Walters
2012-03-01 22:30 ` Mark Walters [this message]
2012-03-01 22:30 ` [Patch v7 04/13] lib: Rearrange the exclude code in query.cc Mark Walters
2012-03-01 22:30 ` [Patch v7 05/13] lib: Make notmuch_query_search_messages set the exclude flag Mark Walters
2012-03-01 22:30 ` [Patch v7 06/13] lib: Add the exclude flag to notmuch_query_search_threads Mark Walters
2012-03-01 22:30 ` [Patch v7 07/13] test: update search test to reflect exclude flag Mark Walters
2012-03-01 22:30 ` [Patch v7 08/13] cli: Make notmuch-show respect excludes Mark Walters
2012-03-01 22:30 ` [Patch v7 09/13] test: update tests to reflect the exclude flag Mark Walters
2012-03-01 22:30 ` [Patch v7 10/13] man: update manpage for notmuch-show --no-exclude option Mark Walters
2012-03-01 22:30 ` [Patch v7 11/13] cli: omit excluded messages in results where appropriate Mark Walters
2012-03-01 22:30 ` [Patch v7 12/13] emacs: show: recognize the exclude flag Mark Walters
2012-03-01 22:30 ` [Patch v7 13/13] emacs: notmuch.el ignore excluded matches Mark Walters
2012-03-02 13:03 ` [Patch v7 00/13] Add NOTMUCH_MESSAGE_FLAG_EXCLUDED flag David Bremner
2012-03-02 20:31 ` Mark Walters
2012-03-03  3:42 ` Mark Walters
2012-03-03 12:41   ` Mark Walters

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1330641045-27416-4-git-send-email-markwalters1009@gmail.com \
    --to=markwalters1009@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).