]> git.notmuchmail.org Git - notmuch/blob - test/dump-restore
466f363d3c462380a53f45028bc21814a42c1ba2
[notmuch] / test / dump-restore
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