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 &&
|
|
|
|
$NOTMUCH dump dump.expected"
|
|
|
|
|
|
|
|
test_begin_subtest "Clearing all tags"
|
2010-06-10 08:48:03 +02:00
|
|
|
sed -e "s/(\([^(]*\))$/()/" < dump.expected > clear.expected
|
2010-09-18 00:25:39 +02:00
|
|
|
$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)"
|
2010-06-10 08:48:03 +02:00
|
|
|
|
2010-09-18 00:25:39 +02:00
|
|
|
test_expect_success "Restore with nothing to do" "$NOTMUCH restore dump.expected"
|
2010-06-10 08:48:03 +02:00
|
|
|
|
|
|
|
test_done
|