]> git.notmuchmail.org Git - notmuch/blob - test/T670-duplicate-mid.sh
test: add known broken tests for duplicate message id
[notmuch] / test / T670-duplicate-mid.sh
1 #!/usr/bin/env bash
2 test_description="duplicate message ids"
3 . ./test-lib.sh || exit 1
4
5 add_message '[id]="duplicate"' '[subject]="message 1" [filename]=copy1'
6 add_message '[id]="duplicate"' '[subject]="message 2" [filename]=copy2'
7
8 test_begin_subtest 'Search for second subject'
9 test_subtest_known_broken
10 cat <<EOF >EXPECTED
11 MAIL_DIR/copy1
12 MAIL_DIR/copy2
13 EOF
14 notmuch search --output=files subject:'"message 2"' | notmuch_dir_sanitize > OUTPUT
15 test_expect_equal_file EXPECTED OUTPUT
16
17 add_message '[id]="duplicate"' '[body]="sekrit" [filename]=copy3'
18 test_begin_subtest 'search for body in duplicate file'
19 test_subtest_known_broken
20 cat <<EOF >EXPECTED
21 MAIL_DIR/copy1
22 MAIL_DIR/copy2
23 MAIL_DIR/copy3
24 EOF
25 notmuch search --output=files "sekrit" | notmuch_dir_sanitize > OUTPUT
26 test_expect_equal_file EXPECTED OUTPUT
27
28 test_done