2010-06-10 08:48:03 +02:00
|
|
|
#!/bin/bash
|
|
|
|
test_description="\"notmuch dump\" and \"notmuch restore\""
|
|
|
|
. ./test-lib.sh
|
|
|
|
|
2010-09-18 00:25:39 +02:00
|
|
|
test_expect_success "Dumping all tags" "generate_message &&
|
|
|
|
notmuch new &&
|
2010-09-21 01:13:15 +02:00
|
|
|
notmuch dump dump.expected"
|
2010-09-18 00:25:39 +02:00
|
|
|
|
|
|
|
test_begin_subtest "Clearing all tags"
|
2010-06-10 08:48:03 +02:00
|
|
|
sed -e "s/(\([^(]*\))$/()/" < dump.expected > clear.expected
|
2010-09-21 01:13:15 +02:00
|
|
|
notmuch restore clear.expected
|
|
|
|
notmuch dump clear.actual
|
2010-09-18 00:25:39 +02:00
|
|
|
test_expect_equal "$(< clear.actual)" "$(< clear.expected)"
|
|
|
|
|
|
|
|
test_begin_subtest "Restoring original tags"
|
2010-09-21 01:13:15 +02:00
|
|
|
notmuch restore dump.expected
|
|
|
|
notmuch dump dump.actual
|
2010-09-18 00:25:39 +02:00
|
|
|
test_expect_equal "$(< dump.actual)" "$(< dump.expected)"
|
2010-06-10 08:48:03 +02:00
|
|
|
|
2010-09-21 01:13:15 +02:00
|
|
|
test_expect_success "Restore with nothing to do" "notmuch restore dump.expected"
|
2010-06-10 08:48:03 +02:00
|
|
|
|
|
|
|
test_done
|