Re: [PATCH 1/3] test: Add compact test

Subject: Re: [PATCH 1/3] test: Add compact test

Date: Sun, 20 Oct 2013 09:18:05 -0300

To: Ben Gamari, notmuch@notmuchmail.org

Cc:

From: David Bremner


Hi Ben;

Thanks for writing these tests. I have some proposed changes. I didn't
understand why you called notmuch search twice, and for whatever reason
test_begin_subtest doesn't pair up with test_expect_success

diff --git a/test/compact b/test/compact
index 54e85ab..5bb5cea 100755
--- a/test/compact
+++ b/test/compact
@@ -10,11 +10,9 @@ notmuch tag +tag1 \*
 notmuch tag +tag2 subject:Two
 notmuch tag -tag1 +tag3 subject:Three
 
-test_begin_subtest "Compacting"
-notmuch compact
-test_expect_success "compact" "notmuch compact"
+test_expect_success "Running compact" "notmuch compact"
 
-notmuch search \*
+test_begin_subtest "Compact preserves database"
 output=$(notmuch search \* | notmuch_search_sanitize)
 test_expect_equal "$output" "\
 thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; One (inbox tag1 unread)
@@ -25,7 +23,6 @@ test_begin_subtest "Restoring backup"
 rm -Rf ${TEST_TMPDIR}/mail/xapian
 mv ${TEST_TMPDIR}/mail/xapian.old ${TEST_TMPDIR}/mail/xapian
 
-notmuch search \*
 output=$(notmuch search \* | notmuch_search_sanitize)
 test_expect_equal "$output" "\
 thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; One (inbox tag1 unread)

Thread: