]> git.notmuchmail.org Git - notmuch/blob - test/t0006-dump-restore.sh
21f91055386f280e0c58545de5c04bb4c9f9c4bd
[notmuch] / test / t0006-dump-restore.sh
1 #!/bin/bash
2 test_description="\"notmuch dump\" and \"notmuch restore\""
3 . ./test-lib.sh
4
5 test_expect_success "Dumping all tags" "generate_message &&
6 notmuch new &&
7 $NOTMUCH dump dump.expected"
8
9 test_begin_subtest "Clearing all tags"
10 sed -e "s/(\([^(]*\))$/()/" < dump.expected > clear.expected
11 $NOTMUCH restore clear.expected 
12 $NOTMUCH dump clear.actual
13 test_expect_equal "$(< clear.actual)" "$(< clear.expected)"
14
15 test_begin_subtest "Restoring original tags"
16 $NOTMUCH restore dump.expected
17 $NOTMUCH dump dump.actual
18 test_expect_equal "$(< dump.actual)" "$(< dump.expected)"
19
20 test_expect_success "Restore with nothing to do" "$NOTMUCH restore dump.expected"
21
22 test_done