]> git.notmuchmail.org Git - notmuch/blobdiff - test/T700-reindex.sh
test: add regression test for large number of deletions
[notmuch] / test / T700-reindex.sh
index 3d7c930d6bdb0fe557b665c76385e5343478d541..bac43dc5e16df214dafb1d3a3698d0033bab741c 100755 (executable)
@@ -6,8 +6,8 @@ add_email_corpus
 
 notmuch tag +usertag1 '*'
 
-notmuch search '*' | notmuch_search_sanitize > initial-threads
-notmuch search --output=messages '*' > initial-message-ids
+notmuch search '*' 2>1 | notmuch_search_sanitize > initial-threads
+notmuch search --output=messages '*' 2>/dev/null > initial-message-ids
 notmuch dump > initial-dump
 
 test_begin_subtest 'reindex preserves threads'
@@ -34,11 +34,11 @@ notmuch dump > OUTPUT
 test_expect_equal_file initial-dump OUTPUT
 
 test_begin_subtest 'reindex preserves tags with special prefixes'
-notmuch tag +attachment2 +encrypted2 +signed2  '*'
+notmuch tag +attachment2 +encrypted2 +signed2 '*'
 notmuch dump > EXPECTED
 notmuch reindex '*'
 notmuch dump > OUTPUT
-notmuch tag -attachment2 -encrypted2 -signed2  '*'
+notmuch tag -attachment2 -encrypted2 -signed2 '*'
 test_expect_equal_file EXPECTED OUTPUT
 
 test_begin_subtest 'reindex moves a message between threads'
@@ -83,4 +83,11 @@ notmuch reindex '*'
 notmuch search '*' | notmuch_search_sanitize > OUTPUT
 test_expect_equal_file EXPECTED OUTPUT
 
+
+test_begin_subtest "reindex after removing corpus"
+tar cf backup.tar mail/cur
+find mail/cur -type f -delete
+test_expect_success "notmuch reindex '*'"
+tar xf backup.tar
+
 test_done