From: David Bremner Date: Sun, 20 Oct 2013 12:18:05 +0000 (+2100) Subject: Re: [PATCH 1/3] test: Add compact test X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3055a1b5a66ed714ef772145a9e578d980662ae9;p=notmuch-archives.git Re: [PATCH 1/3] test: Add compact test --- diff --git a/9d/83b5589e68909c97d1d088406cce453150bd51 b/9d/83b5589e68909c97d1d088406cce453150bd51 new file mode 100644 index 000000000..1118520b7 --- /dev/null +++ b/9d/83b5589e68909c97d1d088406cce453150bd51 @@ -0,0 +1,85 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 2A4CE431FC2 + for ; Sun, 20 Oct 2013 05:18:19 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 2zl1+2PhLtE2 for ; + Sun, 20 Oct 2013 05:18:14 -0700 (PDT) +Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 6B8A0431FC0 + for ; Sun, 20 Oct 2013 05:18:14 -0700 (PDT) +Received: from remotemail by yantan.tethera.net with local (Exim 4.80) + (envelope-from ) + id 1VXrxR-0006WF-FA; Sun, 20 Oct 2013 09:18:09 -0300 +Received: (nullmailer pid 23056 invoked by uid 1000); Sun, 20 Oct 2013 + 12:18:05 -0000 +From: David Bremner +To: Ben Gamari , notmuch@notmuchmail.org +Subject: Re: [PATCH 1/3] test: Add compact test +In-Reply-To: <1381799585-16274-2-git-send-email-bgamari.foss@gmail.com> +References: <1381799585-16274-1-git-send-email-bgamari.foss@gmail.com> + <1381799585-16274-2-git-send-email-bgamari.foss@gmail.com> +User-Agent: Notmuch/0.16+97~g6878b0b (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-pc-linux-gnu) +Date: Sun, 20 Oct 2013 09:18:05 -0300 +Message-ID: <874n8cw2yq.fsf@zancas.localnet> +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 20 Oct 2013 12:18:19 -0000 + + +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)