aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Austin Clements <amdragon@MIT.EDU>2014-06-15 22:40:31 -0400
committerGravatar David Bremner <david@tethera.net>2014-06-18 17:54:05 -0300
commitb547830783ee0732696d5c05a00cfc57baba065f (patch)
treecc7a95d5cd0036c2c9e46982268cb854daf83fae /test
parent8a443121c63ee38354cd8f657a1a308311faae9d (diff)
test: Add search tests for combined name/address queries
Two of these are currently known-broken. We index the name and address parts in two separate calls to _notmuch_message_gen_terms. Currently this has the effect of placing the term positions of the prefixed terms from the second call right after those of the first call, but screws up the term positions of the non-prefixed terms.
Diffstat (limited to 'test')
-rwxr-xr-xtest/T080-search.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/T080-search.sh b/test/T080-search.sh
index 4f0e16cf..8ed57013 100755
--- a/test/T080-search.sh
+++ b/test/T080-search.sh
@@ -62,6 +62,15 @@ add_message '[subject]="search by from (name)"' '[date]="Sat, 01 Jan 2000 12:00:
output=$(notmuch search 'from:"Search By From Name"' | notmuch_search_sanitize)
test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Search By From Name; search by from (name) (inbox unread)"
+test_begin_subtest "Search by from: (name and address)"
+output=$(notmuch search 'from:"Search By From Name <test@example.com>"' | notmuch_search_sanitize)
+test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Search By From Name; search by from (name) (inbox unread)"
+
+test_begin_subtest "Search by from: without prefix (name and address)"
+test_subtest_known_broken
+output=$(notmuch search '"Search By From Name <test@example.com>"' | notmuch_search_sanitize)
+test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Search By From Name; search by from (name) (inbox unread)"
+
test_begin_subtest "Search by to: (address)"
add_message '[subject]="search by to (address)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' [to]=searchbyto@example.com
output=$(notmuch search to:searchbyto@example.com | notmuch_search_sanitize)
@@ -72,6 +81,15 @@ add_message '[subject]="search by to (name)"' '[date]="Sat, 01 Jan 2000 12:00:00
output=$(notmuch search 'to:"Search By To Name"' | notmuch_search_sanitize)
test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (name) (inbox unread)"
+test_begin_subtest "Search by to: (name and adress)"
+output=$(notmuch search 'to:"Search By To Name <test@example.com>"' | notmuch_search_sanitize)
+test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (name) (inbox unread)"
+
+test_begin_subtest "Search by to: without prefix (name and adress)"
+test_subtest_known_broken
+output=$(notmuch search '"Search By To Name <test@example.com>"' | notmuch_search_sanitize)
+test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (name) (inbox unread)"
+
test_begin_subtest "Search by subject: (phrase)"
add_message '[subject]="subject search test (phrase)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"'
add_message '[subject]="this phrase should not match the subject search test"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"'