2 test_description="duplicate message ids"
3 . ./test-lib.sh || exit 1
5 add_message '[id]="duplicate"' '[subject]="message 1" [filename]=copy1'
6 add_message '[id]="duplicate"' '[subject]="message 2" [filename]=copy2'
8 test_begin_subtest 'First subject preserved'
10 thread:XXX 2001-01-05 [1/1(2)] Notmuch Test Suite; message 1 (inbox unread)
12 notmuch search id:duplicate | notmuch_search_sanitize > OUTPUT
13 test_expect_equal_file EXPECTED OUTPUT
15 test_begin_subtest 'Search for second subject'
20 notmuch search --output=files subject:'"message 2"' | notmuch_dir_sanitize > OUTPUT
21 test_expect_equal_file EXPECTED OUTPUT
23 add_message '[id]="duplicate"' '[body]="sekrit" [filename]=copy3'
24 test_begin_subtest 'search for body in duplicate file'
30 notmuch search --output=files "sekrit" | notmuch_dir_sanitize > OUTPUT
31 test_expect_equal_file EXPECTED OUTPUT
34 test_begin_subtest 'reindex drops terms in duplicate file'
37 notmuch search --output=files "sekrit" | notmuch_dir_sanitize > OUTPUT
38 test_expect_equal_file EXPECTED OUTPUT