2 test_description='folder tags removed and added through file renames remain consistent'
5 test_begin_subtest "No new messages"
7 test_expect_equal "$output" "No new mail."
10 test_begin_subtest "Single new message"
12 file_x=$gen_msg_filename
15 test_expect_equal "$output" "Added 1 new message to the database."
17 test_begin_subtest "Add second folder for same message"
18 dir=$(dirname $file_x)
22 test_expect_equal "$output" "No new mail."
25 test_begin_subtest "Multiple files for same message"
30 notmuch search --output=files id:$id_x | notmuch_search_files_sanitize >OUTPUT
31 test_expect_equal_file OUTPUT EXPECTED
33 test_begin_subtest "Test matches folder:spam"
34 output=$(notmuch search folder:spam)
35 test_expect_equal "$output" "thread:0000000000000001 2001-01-05 [1/1] Notmuch Test Suite; Single new message (inbox unread)"
37 test_begin_subtest "Remove folder:spam copy of email"
38 rm $dir/spam/$(basename $file_x)
40 test_expect_equal "$output" "No new mail. Detected 1 file rename."
42 test_begin_subtest "No mails match the folder:spam search"
43 output=$(notmuch search folder:spam)
44 test_expect_equal "$output" ""