X-Git-Url: https://git.cworth.org/git?p=notmuch;a=blobdiff_plain;f=test%2FT240-dump-restore.sh;h=a86f0fb7e8f0440de6268075e91ba3b4262a38b1;hp=75fb0b404bbebbf134cc4fe7c040016817245910;hb=a06b76b9b3c1212b17d2bb170bdd511711f578f8;hpb=ec3937b5cd2884504d5536dc8631a15fd506050b diff --git a/test/T240-dump-restore.sh b/test/T240-dump-restore.sh index 75fb0b40..a86f0fb7 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 || exit 1 +. $(dirname "$0")/test-lib.sh || exit 1 NOTMUCH_NEW > /dev/null test_begin_subtest "dump header" @@ -65,7 +65,7 @@ test_begin_subtest "Accumulate with new tags" test_expect_success \ 'notmuch restore --input=dump.expected && notmuch restore --accumulate --input=dump-ABC_DEF.expected && - notmuch dump > OUTPUT.$test_count && + notmuch dump > OUTPUT.$test_count && notmuch restore --input=dump.expected && test_cmp dump-ABC_DEF.expected OUTPUT.$test_count' @@ -117,6 +117,19 @@ test_begin_subtest "dump -- from:cworth" notmuch dump -- from:cworth > dump-dash-cworth.actual test_expect_equal_file dump-cworth.expected dump-dash-cworth.actual + +if [ $NOTMUCH_HAVE_SFSEXP -eq 1 ]; then + + test_begin_subtest "dump --query=sexp -- '(from cworth)'" + notmuch dump --query=sexp -- '(from cworth)' > dump-dash-cworth.actual2 + test_expect_equal_file_nonempty dump-cworth.expected dump-dash-cworth.actual2 + + test_begin_subtest "dump --query=sexp --output=outfile '(from cworth)'" + notmuch dump --output=dump-outfile-cworth.actual2 --query=sexp '(from cworth)' + test_expect_equal_file dump-cworth.expected dump-outfile-cworth.actual2 + +fi + test_begin_subtest "dump --output=outfile from:cworth" notmuch dump --output=dump-outfile-cworth.actual from:cworth test_expect_equal_file dump-cworth.expected dump-outfile-cworth.actual @@ -235,7 +248,7 @@ test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count test_begin_subtest 'format=batch-tag, checking encoded output' NOTMUCH_DUMP_TAGS --format=batch-tag -- from:cworth |\ awk "{ print \"+$enc1 +$enc2 +$enc3 -- \" \$5 }" > EXPECTED.$test_count -NOTMUCH_DUMP_TAGS --format=batch-tag -- from:cworth > OUTPUT.$test_count +NOTMUCH_DUMP_TAGS --format=batch-tag -- from:cworth > OUTPUT.$test_count test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count test_begin_subtest 'restoring sane tags' @@ -322,6 +335,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} \ @@ -338,7 +352,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.