X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2FT240-dump-restore.sh;h=e6976ff8f2788634d202ed63e0960b0fa0cf6227;hp=0004438db493514fed25c95fe244c0eab1767a06;hb=e366bb222722d6a635b736e875b760d82b46d1f5;hpb=a755c9d6a9099366cc82ba3a4bee8e6d2b83d529 diff --git a/test/T240-dump-restore.sh b/test/T240-dump-restore.sh index 0004438d..e6976ff8 100755 --- a/test/T240-dump-restore.sh +++ b/test/T240-dump-restore.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash test_description="\"notmuch dump\" and \"notmuch restore\"" -. ./test-lib.sh +. ./test-lib.sh || exit 1 add_email_corpus @@ -68,6 +68,32 @@ test_begin_subtest "dump --output=outfile --" notmuch dump --output=dump-1-arg-dash.actual -- test_expect_equal_file dump.expected dump-1-arg-dash.actual +# gzipped output + +test_begin_subtest "dump --gzip" +notmuch dump --gzip > dump-gzip.gz +gunzip dump-gzip.gz +test_expect_equal_file dump.expected dump-gzip + +test_begin_subtest "dump --gzip --output=outfile" +notmuch dump --gzip --output=dump-gzip-outfile.gz +gunzip dump-gzip-outfile.gz +test_expect_equal_file dump.expected dump-gzip-outfile + +test_begin_subtest "restoring gzipped stdin" +notmuch dump --gzip --output=backup.gz +notmuch tag +new_tag '*' +notmuch restore < backup.gz +notmuch dump --output=dump.actual +test_expect_equal_file dump.expected dump.actual + +test_begin_subtest "restoring gzipped file" +notmuch dump --gzip --output=backup.gz +notmuch tag +new_tag '*' +notmuch restore --input=backup.gz +notmuch dump --output=dump.actual +test_expect_equal_file dump.expected dump.actual + # Note, we assume all messages from cworth have a message-id # containing cworth.org @@ -98,6 +124,15 @@ notmuch dump --format=batch-tag from:cworth | sed 's/^.*-- id://' | \ sort > OUTPUT.$test_count test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count +test_begin_subtest "format=batch-tag, missing newline" +printf "+a_tag_without_newline -- id:20091117232137.GA7669@griffis1.net" > IN +notmuch restore --accumulate < IN +notmuch dump id:20091117232137.GA7669@griffis1.net > OUT +cat < EXPECTED ++a_tag_without_newline +inbox +unread -- id:20091117232137.GA7669@griffis1.net +EOF +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