X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2Fmaildir-sync;h=50a5b8e617b17a59a66ca4a1356e550c1736d7b1;hp=063c4a7622c8363e997bf222b084ae329631e40e;hb=96d99c383785dec67443ff1b45e2d2f8437398fa;hpb=882b994c173475f8973d5f5a1c0d1c25e4f93818 diff --git a/test/maildir-sync b/test/maildir-sync index 063c4a76..50a5b8e6 100755 --- a/test/maildir-sync +++ b/test/maildir-sync @@ -12,11 +12,6 @@ filter_show_json() { echo } -cat >> "$NOTMUCH_CONFIG" </dev/null @@ -131,4 +141,38 @@ notmuch restore dump.txt output=$(ls $MAIL_DIR/cur) test_expect_equal "$output" "$expected" +test_begin_subtest 'Adding flags to duplicate message tags the mail' +add_message [subject]='"Duplicated message"' [dir]=cur [filename]='duplicated-message:2,' +cp "$MAIL_DIR/cur/duplicated-message:2," "$MAIL_DIR/cur/duplicated-message-copy:2,RS" +increment_mtime $MAIL_DIR/cur +NOTMUCH_NEW > output +notmuch search subject:"Duplicated message" | notmuch_search_sanitize >> output +test_expect_equal "$(< output)" "No new mail. +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Duplicated message (inbox replied)" + +test_begin_subtest "Adding duplicate message without flags does not remove tags" +cp "$MAIL_DIR/cur/duplicated-message-copy:2,RS" "$MAIL_DIR/cur/duplicated-message-another-copy:2," +increment_mtime $MAIL_DIR/cur +NOTMUCH_NEW > output +notmuch search subject:"Duplicated message" | notmuch_search_sanitize >> output +test_expect_equal "$(< output)" "No new mail. +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Duplicated message (inbox replied)" + +test_begin_subtest "Tag changes modify flags of multiple files" +notmuch tag -replied subject:"Duplicated message" +(cd $MAIL_DIR/cur/; ls duplicated*) > actual +test_expect_equal "$(< actual)" "duplicated-message-another-copy:2,S +duplicated-message-copy:2,S +duplicated-message:2,S" + +test_begin_subtest "Synchronizing tag changes preserves unsupported maildir flags" +add_message [subject]='"Unsupported maildir flags"' [dir]=cur [filename]='unsupported-maildir-flags:2,FSZxyz' +notmuch tag +unread +draft -flagged subject:"Unsupported maildir flags" +test_expect_equal "$(cd $MAIL_DIR/cur/; ls unsupported*)" "unsupported-maildir-flags:2,DZxyz" + +test_begin_subtest "A file with non-compliant maildir info will not be renamed" +add_message [subject]='"Non-compliant maildir info"' [dir]=cur [filename]='non-compliant-maildir-info:2,These-are-not-flags-in-ASCII-order-donottouch' +notmuch tag +unread +draft -flagged subject:"Non-compliant maildir info" +test_expect_equal "$(cd $MAIL_DIR/cur/; ls non-compliant*)" "non-compliant-maildir-info:2,These-are-not-flags-in-ASCII-order-donottouch" + test_done