2 test_description='search body'
3 . $(dirname "$0")/test-lib.sh || exit 1
5 add_message "[body]=thebody-1" "[subject]=subject-1"
6 add_message "[body]=nothing-to-see-here-1" "[subject]=thebody-1"
8 test_begin_subtest 'search with body: prefix'
9 notmuch search body:thebody | notmuch_search_sanitize > OUTPUT
11 thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; subject-1 (inbox unread)
13 test_expect_equal_file EXPECTED OUTPUT
15 test_begin_subtest 'search without body: prefix'
16 notmuch search thebody | notmuch_search_sanitize > OUTPUT
18 thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; subject-1 (inbox unread)
19 thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; thebody-1 (inbox unread)
21 test_expect_equal_file EXPECTED OUTPUT
23 test_begin_subtest 'negated body: prefix'
24 notmuch search thebody and not body:thebody | notmuch_search_sanitize > OUTPUT
26 thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; thebody-1 (inbox unread)
28 test_expect_equal_file EXPECTED OUTPUT
30 test_begin_subtest 'search unprefixed for prefixed term'
31 notmuch search subject | notmuch_search_sanitize > OUTPUT
33 thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; subject-1 (inbox unread)
35 test_expect_equal_file EXPECTED OUTPUT
37 test_begin_subtest 'search with body: prefix for term only in subject'
38 notmuch search body:subject | notmuch_search_sanitize > OUTPUT
41 test_expect_equal_file EXPECTED OUTPUT