2 test_description='"notmuch new" with directory renames'
3 . $(dirname "$0")/test-lib.sh || exit 1
5 for loop in {1..10}; do
10 generate_message '[dir]=foo' '[subject]="Message foo $i"'
14 generate_message '[dir]=bar' '[subject]="Message bar $i"'
17 test_begin_subtest "Index the messages, round $loop"
19 test_expect_equal "$output" "Added 20 new messages to the database."
21 all_files=$(notmuch search --output=files \*)
22 count_foo=$(notmuch count folder:foo)
24 test_begin_subtest "Rename folder"
25 mv ${MAIL_DIR}/foo ${MAIL_DIR}/baz
27 test_expect_equal "$output" "No new mail. Detected $count_foo file renames."
29 test_begin_subtest "Rename folder back"
30 mv ${MAIL_DIR}/baz ${MAIL_DIR}/foo
32 test_expect_equal "$output" "No new mail. Detected $count_foo file renames."
34 test_begin_subtest "Files remain the same"
35 output=$(notmuch search --output=files \*)
36 test_expect_equal "$output" "$all_files"