notmuch tag +tag2 subject:Two
notmuch tag -tag1 +tag3 subject:Three
-test_expect_success "Running compact" "notmuch compact"
+test_expect_success "Running compact" "notmuch compact --backup=${TEST_DIRECTORY}/xapian.old"
test_begin_subtest "Compact preserves database"
output=$(notmuch search \* | notmuch_search_sanitize)
test_expect_success 'Restoring Backup' \
'rm -Rf ${MAIL_DIR}/.notmuch/xapian &&
- mv ${MAIL_DIR}/xapian.old ${MAIL_DIR}/.notmuch/xapian'
+ mv ${TEST_DIRECTORY}/xapian.old ${MAIL_DIR}/.notmuch/xapian'
test_begin_subtest "Checking restored backup"
output=$(notmuch search \* | notmuch_search_sanitize)