X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;ds=sidebyside;f=test%2FT240-dump-restore.sh;h=da7502c99a1ddcca4aa3a6aa5f80b8821d3f3395;hb=4c79a2dabe38ac72eb9eb21620f2ffca5f1885c6;hp=206c3ae14560c9e3436ecc6e5e01f8bce48c0cdc;hpb=d0cd253b37646d9364d046e1d3edb022a58c105a;p=notmuch diff --git a/test/T240-dump-restore.sh b/test/T240-dump-restore.sh index 206c3ae1..da7502c9 100755 --- a/test/T240-dump-restore.sh +++ b/test/T240-dump-restore.sh @@ -1,7 +1,14 @@ #!/usr/bin/env bash test_description="\"notmuch dump\" and \"notmuch restore\"" -. ./test-lib.sh || exit 1 +. $(dirname "$0")/test-lib.sh || exit 1 +NOTMUCH_NEW > /dev/null +test_begin_subtest "dump header" +cat < EXPECTED +#notmuch-dump batch-tag:3 config,properties,tags +EOF +notmuch dump > OUTPUT +test_expect_equal_file EXPECTED OUTPUT add_email_corpus test_begin_subtest "Dumping all tags" @@ -122,7 +129,7 @@ test_begin_subtest "Check for a safe set of message-ids" notmuch search --output=messages from:cworth | sed s/^id:// > EXPECTED notmuch search --output=messages from:cworth | sed s/^id:// |\ $TEST_DIRECTORY/hex-xcode --direction=encode > OUTPUT -test_expect_equal_file OUTPUT EXPECTED +test_expect_equal_file EXPECTED OUTPUT test_begin_subtest "format=batch-tag, dump sanity check." NOTMUCH_DUMP_TAGS --format=sup from:cworth | cut -f1 -d' ' | \ @@ -315,6 +322,7 @@ EOF test_expect_equal_file EXPECTED OUTPUT +backup_database test_begin_subtest 'roundtripping random message-ids and tags' ${TEST_DIRECTORY}/random-corpus --config-path=${NOTMUCH_CONFIG} \ @@ -331,7 +339,7 @@ test_begin_subtest 'roundtripping random message-ids and tags' sort > OUTPUT.$test_count test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count +restore_database test_done -# Note the database is "poisoned" for sup format at this point.