X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2FT700-reindex.sh;h=bac43dc5e16df214dafb1d3a3698d0033bab741c;hb=8322f536f5d304cc10caa2e061a36df0aa1996c4;hp=051fbb3cef4812d4c488440d40d002c56bf4c583;hpb=84ae74aada7d4a4574c09a81c9bddcc947d834b1;p=notmuch diff --git a/test/T700-reindex.sh b/test/T700-reindex.sh index 051fbb3c..bac43dc5 100755 --- a/test/T700-reindex.sh +++ b/test/T700-reindex.sh @@ -1,13 +1,13 @@ #!/usr/bin/env bash test_description='reindexing messages' -. ./test-lib.sh || exit 1 +. $(dirname "$0")/test-lib.sh || exit 1 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' @@ -33,6 +33,14 @@ notmuch reindex '*' 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 dump > EXPECTED +notmuch reindex '*' +notmuch dump > OUTPUT +notmuch tag -attachment2 -encrypted2 -signed2 '*' +test_expect_equal_file EXPECTED OUTPUT + test_begin_subtest 'reindex moves a message between threads' notmuch search --output=threads id:87iqd9rn3l.fsf@vertex.dottedmag > EXPECTED # re-parent @@ -66,7 +74,6 @@ notmuch restore < prop-dump notmuch reindex '*' notmuch dump | grep '^#=' | sort > OUTPUT test_expect_equal_file prop-dump OUTPUT -test_done add_email_corpus lkml @@ -76,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