notmuch/test/dump-restore
Carl Worth 5497b01c27 test: Fix the search and dump-restore tests to operator on non-empty mail store.
We do this with a new add_email_corpus function that establishes a
mail store with 50 messages from the notmuch mailing list.
2010-09-20 16:40:35 -07:00

24 lines
680 B
Bash
Executable file

#!/bin/bash
test_description="\"notmuch dump\" and \"notmuch restore\""
. ./test-lib.sh
add_email_corpus
test_expect_success "Dumping all tags" "generate_message &&
notmuch new &&
notmuch dump dump.expected"
test_begin_subtest "Clearing all tags"
sed -e "s/(\([^(]*\))$/()/" < dump.expected > clear.expected
notmuch restore clear.expected
notmuch dump clear.actual
test_expect_equal "$(< clear.actual)" "$(< clear.expected)"
test_begin_subtest "Restoring original tags"
notmuch restore dump.expected
notmuch dump dump.actual
test_expect_equal "$(< dump.actual)" "$(< dump.expected)"
test_expect_success "Restore with nothing to do" "notmuch restore dump.expected"
test_done