X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2FT650-regexp-query.sh;h=43af3b47ced7826ed0a710a3bda3e9df1b54c2a1;hp=b7bdda118e97850f4c8c25bb9607c313fd4b1123;hb=cd8006886b1c80ff556a96f1e84e3d3914067a54;hpb=523d2b50fcaae90cbe09975c1f1bc652ff521ec6 diff --git a/test/T650-regexp-query.sh b/test/T650-regexp-query.sh index b7bdda11..43af3b47 100755 --- a/test/T650-regexp-query.sh +++ b/test/T650-regexp-query.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash test_description='regular expression searches' -. ./test-lib.sh || exit 1 +. $(dirname "$0")/test-lib.sh || exit 1 if [ $NOTMUCH_HAVE_XAPIAN_FIELD_PROCESSOR -eq 0 ]; then test_done @@ -29,7 +29,7 @@ test_expect_equal_file EXPECTED OUTPUT test_begin_subtest "unanchored folder:// specification" output=$(notmuch search folder:/bad/ | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; To the bone (inbox unread) -thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Bears (inbox unread) +thread:XXX 2001-01-05 [1/1(2)] Notmuch Test Suite; Bears (inbox unread) thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Bites, stings, sad feelings (inbox unread)" test_begin_subtest "anchored folder:// search" @@ -39,7 +39,7 @@ test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; T test_begin_subtest "unanchored path:// specification" 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) -thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Bears (inbox unread) +thread:XXX 2001-01-05 [1/1(2)] Notmuch Test Suite; Bears (inbox unread) thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Bites, stings, sad feelings (inbox unread)" test_begin_subtest "anchored path:// search" @@ -47,7 +47,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 @@ -77,6 +76,17 @@ test_expect_equal_file cworth.msg-ids OUTPUT test_begin_subtest "xapian wildcard search for subject:" test_expect_equal $(notmuch count 'subject:count*') 1 +add_message '[from]="and"' '[subject]="and-and-and"' +printf "id:$gen_msg_id\n" > EXPECTED + +test_begin_subtest "quoted xapian keyword search for from:" +notmuch search --output=messages 'from:"and"' > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "quoted xapian keyword search for subject:" +notmuch search --output=messages 'subject:"and-and-and"' > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + test_begin_subtest "regexp from search, case sensitive" notmuch search --output=messages from:/carl/ > OUTPUT test_expect_equal_file /dev/null OUTPUT @@ -137,10 +147,10 @@ EOF test_expect_equal_file EXPECTED OUTPUT test_begin_subtest "regexp error reporting" -notmuch search 'from:/unbalanced[/' 1>OUTPUT 2>&1 +notmuch search 'from:/unbalanced[/' 2>&1 | sed -e '/^A Xapian/ s/[^:]*$//' > OUTPUT cat < EXPECTED notmuch search: A Xapian exception occurred -A Xapian exception occurred parsing query: Invalid regular expression +A Xapian exception occurred parsing query: Regexp error: Query string was: from:/unbalanced[/ EOF test_expect_equal_file EXPECTED OUTPUT