mirror of
https://git.notmuchmail.org/git/notmuch
synced 2025-01-03 15:21:41 +01:00
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.
This commit is contained in:
parent
4eab10f0f8
commit
98f5b0f09a
2 changed files with 26 additions and 0 deletions
21
test/count
21
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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue