diff options
author | Mark Walters <markwalters1009@gmail.com> | 2012-04-07 17:10:07 +0100 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2012-04-07 23:06:21 -0300 |
commit | 6478e1bc92d60bfd85ef8259a14754e2babe150b (patch) | |
tree | 587c1145ffc491ff7cedebeb6c24d2fcae640427 /test/search | |
parent | 903327279c38d6750e8347eba23262fa487c6951 (diff) |
test: add some exclude tests
Systematically test the exclude options for search. Also move the
search existing exclude tests into the new test. There is some overlap
between the two sets of tests but many of the existing ones are there
because they triggered bugs in the past so I have kept them to ensure
coverage.
Diffstat (limited to 'test/search')
-rwxr-xr-x | test/search | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/test/search b/test/search index 17af6a26..a7a0b18d 100755 --- a/test/search +++ b/test/search @@ -129,52 +129,4 @@ add_message '[subject]="utf8-message-body-subject"' '[date]="Sat, 01 Jan 2000 12 output=$(notmuch search "bödý" | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; utf8-message-body-subject (inbox unread)" -test_begin_subtest "Exclude \"deleted\" messages from search" -notmuch config set search.exclude_tags deleted -generate_message '[subject]="Not deleted"' -not_deleted_id=$gen_msg_id -generate_message '[subject]="Deleted"' -notmuch new > /dev/null -notmuch tag +deleted id:$gen_msg_id -deleted_id=$gen_msg_id -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 [0/1] Notmuch Test Suite; Deleted (deleted inbox unread)" - -test_begin_subtest "Exclude \"deleted\" messages from message search" -output=$(notmuch search --output=messages subject:deleted | notmuch_search_sanitize) -test_expect_equal "$output" "id:$not_deleted_id" - -test_begin_subtest "Exclude \"deleted\" messages from message search (no-exclude)" -output=$(notmuch search --no-exclude --output=messages subject:deleted | notmuch_search_sanitize) -test_expect_equal "$output" "id:$not_deleted_id -id:$deleted_id" - -test_begin_subtest "Exclude \"deleted\" messages from message search (non-existent exclude-tag)" -notmuch config set search.exclude_tags deleted non_existent_tag -output=$(notmuch search --output=messages subject:deleted | notmuch_search_sanitize) -test_expect_equal "$output" "id:$not_deleted_id" -notmuch config set search.exclude_tags deleted - -test_begin_subtest "Exclude \"deleted\" messages from search, overridden" -output=$(notmuch search subject:deleted and tag:deleted | notmuch_search_sanitize) -test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Deleted (deleted inbox unread)" - -test_begin_subtest "Exclude \"deleted\" messages from threads" -add_message '[subject]="Not deleted reply"' '[in-reply-to]="<$gen_msg_id>"' -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) -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_done |