X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2Finsert;h=e8dc4c099ed149c1b76e938efc4b16346d7441fc;hb=84719b08f757a6079f4c3331d0c476d19b265948;hp=9b448e5a4c6f68df0f5b0d547461454c0cde2b53;hpb=8ffc60e989a9857855c5429697da80e00785eeec;p=notmuch diff --git a/test/insert b/test/insert index 9b448e5a..e8dc4c09 100755 --- a/test/insert +++ b/test/insert @@ -68,14 +68,14 @@ test_expect_equal_json "$output" '["inbox", "unread"]' test_begin_subtest "Insert message, add tag" gen_insert_msg notmuch insert +custom < "$gen_msg_filename" -output=$(notmuch count tag:custom) -test_expect_equal "$output" "1" +output=$(notmuch search --output=messages tag:custom) +test_expect_equal "$output" "id:$gen_msg_id" test_begin_subtest "Insert message, add/remove tags" gen_insert_msg notmuch insert +custom -unread < "$gen_msg_filename" -output=$(notmuch count tag:custom NOT tag:unread) -test_expect_equal "$output" "1" +output=$(notmuch search --output=messages tag:custom NOT tag:unread) +test_expect_equal "$output" "id:$gen_msg_id" test_begin_subtest "Insert message with default tags stays in new/" gen_insert_msg @@ -113,6 +113,16 @@ output=$(notmuch search --output=files id:$gen_msg_id) dirname=$(dirname "$output") test_expect_equal "$dirname" "$MAIL_DIR/cur" +test_begin_subtest "Insert message with maildir sync off goes to new/" +OLDCONFIG=$(notmuch config get maildir.synchronize_flags) +notmuch config set maildir.synchronize_flags false +gen_insert_msg +notmuch insert +flagged < "$gen_msg_filename" +output=$(notmuch search --output=files id:$gen_msg_id) +dirname=$(dirname "$output") +notmuch config set maildir.synchronize_flags $OLDCONFIG +test_expect_equal "$dirname" "$MAIL_DIR/new" + test_begin_subtest "Insert message into folder" gen_insert_msg notmuch insert --folder=Drafts < "$gen_msg_filename" @@ -123,8 +133,8 @@ test_expect_equal "$dirname" "$MAIL_DIR/Drafts/new" test_begin_subtest "Insert message into folder, add/remove tags" gen_insert_msg notmuch insert --folder=Drafts +draft -unread < "$gen_msg_filename" -output=$(notmuch count folder:Drafts tag:draft NOT tag:unread) -test_expect_equal "$output" "1" +output=$(notmuch search --output=messages folder:Drafts tag:draft NOT tag:unread) +test_expect_equal "$output" "id:$gen_msg_id" gen_insert_msg test_expect_code 1 "Insert message into non-existent folder" \