aboutsummaryrefslogtreecommitdiff
path: root/test/count
diff options
context:
space:
mode:
authorMark Walters <markwalters1009@gmail.com>2012-03-01 22:30:35 +0000
committerDavid Bremner <bremner@debian.org>2012-03-02 08:25:46 -0400
commit98f5b0f09a816dfe5bc206f8b76c87223437e63d (patch)
treef0a00e55dd59369f1b02b5e406884cbcfe754dc6 /test/count
parent4eab10f0f82cbae8635552a05a7d0ee4ca1ef8cc (diff)
test: add tests for new cli --no-exclude option
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.
Diffstat (limited to 'test/count')
-rwxr-xr-xtest/count21
1 files changed, 21 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