X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=test%2FT650-regexp-query.sh;h=a9844501edf4b60f7c2652838a26ef7926363a4c;hb=78632345868b5e4753ad402c806c29569946ce89;hp=e792decf4e1657c08edb45a4d6bbea3b2d2c132d;hpb=168211c5632189c53415d25530b759ad3678c92c;p=notmuch diff --git a/test/T650-regexp-query.sh b/test/T650-regexp-query.sh index e792decf..a9844501 100755 --- a/test/T650-regexp-query.sh +++ b/test/T650-regexp-query.sh @@ -2,10 +2,6 @@ test_description='regular expression searches' . $(dirname "$0")/test-lib.sh || exit 1 -if [ $NOTMUCH_HAVE_XAPIAN_FIELD_PROCESSOR -eq 0 ]; then - test_done -fi - add_message '[dir]=bad' '[subject]="To the bone"' add_message '[dir]=.' '[subject]="Top level"' add_message '[dir]=bad/news' '[subject]="Bears"' @@ -47,7 +43,6 @@ output=$(notmuch search 'path:/^bad$/' | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; To the bone (inbox unread)" # Use "standard" corpus from here on. -rm -rf $MAIL_DIR add_email_corpus notmuch search --output=messages from:cworth > cworth.msg-ids @@ -70,6 +65,31 @@ thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; - (inbox unread) EOF test_expect_equal_file EXPECTED OUTPUT +test_begin_subtest "bracketed subject search (with dquotes)" +notmuch search subject:notmuch and subject:show > EXPECTED +notmuch search 'subject:"(show notmuch)"' > OUTPUT +test_expect_equal_file_nonempty EXPECTED OUTPUT + +test_begin_subtest "bracketed subject search (with dquotes and operator 'or')" +notmuch search subject:notmuch or subject:show > EXPECTED +notmuch search 'subject:"(notmuch or show)"' > OUTPUT +test_expect_equal_file_nonempty EXPECTED OUTPUT + +test_begin_subtest "bracketed subject search (with dquotes and operator 'and')" +notmuch search subject:notmuch and subject:show > EXPECTED +notmuch search 'subject:"(notmuch and show)"' > OUTPUT +test_expect_equal_file_nonempty EXPECTED OUTPUT + +test_begin_subtest "bracketed subject search (with phrase, operator 'or')" +notmuch search 'subject:"mailing list"' or subject:FreeBSD > EXPECTED +notmuch search 'subject:"(""mailing list"" or FreeBSD)"' > OUTPUT +test_expect_equal_file_nonempty EXPECTED OUTPUT + +test_begin_subtest "bracketed subject search (with phrase, operator 'and')" +notmuch search search 'subject:"notmuch show"' and subject:commands > EXPECTED +notmuch search 'subject:"(""notmuch show"" and commands)"' > OUTPUT +test_expect_equal_file_nonempty EXPECTED OUTPUT + test_begin_subtest "xapian wildcard search for from:" notmuch search --output=messages 'from:cwo*' > OUTPUT test_expect_equal_file cworth.msg-ids OUTPUT @@ -81,12 +101,10 @@ add_message '[from]="and"' '[subject]="and-and-and"' printf "id:$gen_msg_id\n" > EXPECTED test_begin_subtest "quoted xapian keyword search for from:" -test_subtest_known_broken notmuch search --output=messages 'from:"and"' > OUTPUT test_expect_equal_file EXPECTED OUTPUT test_begin_subtest "quoted xapian keyword search for subject:" -test_subtest_known_broken notmuch search --output=messages 'subject:"and-and-and"' > OUTPUT test_expect_equal_file EXPECTED OUTPUT