]> git.notmuchmail.org Git - notmuch/blobdiff - test/T240-dump-restore.sh
cli/dump: fix bug in dump header
[notmuch] / test / T240-dump-restore.sh
index bbfb09b928b0d322bd71cb57736596880299efce..181def34566beb01677cfb83e7350f035fdaa32f 100755 (executable)
@@ -2,6 +2,13 @@
 test_description="\"notmuch dump\" and \"notmuch restore\""
 . ./test-lib.sh || exit 1
 
+NOTMUCH_NEW > /dev/null
+test_begin_subtest "dump header"
+cat <<EOF > EXPECTED
+#notmuch-dump batch-tag:2 config,properties,tags
+EOF
+notmuch dump > OUTPUT
+test_expect_equal_file EXPECTED OUTPUT
 add_email_corpus
 
 test_expect_success 'Dumping all tags' \
@@ -135,7 +142,8 @@ test_expect_equal_file EXPECTED OUT
 
 test_begin_subtest "format=batch-tag, # round-trip"
 notmuch dump --format=sup | sort > EXPECTED.$test_count
-notmuch dump --format=batch-tag | notmuch restore --format=batch-tag
+notmuch dump --format=batch-tag > DUMPFILE
+notmuch restore --format=batch-tag < DUMPFILE
 notmuch dump --format=sup | sort > OUTPUT.$test_count
 test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
 
@@ -212,7 +220,8 @@ test_expect_equal_file EXPECTED OUTPUT.$test_count
 
 test_begin_subtest 'format=batch-tag, round trip with strange tags'
 notmuch dump --format=batch-tag > EXPECTED.$test_count
-notmuch dump --format=batch-tag | notmuch restore --format=batch-tag
+notmuch dump --format=batch-tag > DUMPFILE
+notmuch restore --format=batch-tag < DUMPFILE
 notmuch dump --format=batch-tag > OUTPUT.$test_count
 test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count