Re: [PATCH 1/4] test: Add compact test
authorTomi Ollila <tomi.ollila@iki.fi>
Thu, 31 Oct 2013 07:48:46 +0000 (09:48 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:57:48 +0000 (09:57 -0800)
2d/9715ca0d3b5474db0dd364746b4460e388bf95 [new file with mode: 0644]

diff --git a/2d/9715ca0d3b5474db0dd364746b4460e388bf95 b/2d/9715ca0d3b5474db0dd364746b4460e388bf95
new file mode 100644 (file)
index 0000000..886d574
--- /dev/null
@@ -0,0 +1,123 @@
+Return-Path: <tomi.ollila@iki.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 1CB3B431FC4\r
+       for <notmuch@notmuchmail.org>; Thu, 31 Oct 2013 00:49:03 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id F5CeEFT+AS+v for <notmuch@notmuchmail.org>;\r
+       Thu, 31 Oct 2013 00:48:55 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id 78EA1431FC2\r
+       for <notmuch@notmuchmail.org>; Thu, 31 Oct 2013 00:48:55 -0700 (PDT)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+       by guru.guru-group.fi (Postfix) with ESMTP id 3B4DE1000B2;\r
+       Thu, 31 Oct 2013 09:48:47 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Ben Gamari <bgamari.foss@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 1/4] test: Add compact test\r
+In-Reply-To: <1383192608-31047-1-git-send-email-bgamari.foss@gmail.com>\r
+References: <id:m24n80qqy2.fsf@guru.guru-group.fi>\r
+       <1383192608-31047-1-git-send-email-bgamari.foss@gmail.com>\r
+User-Agent: Notmuch/0.16+119~g219c55f (http://notmuchmail.org) Emacs/24.3.1\r
+       (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+       $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+       !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Thu, 31 Oct 2013 09:48:46 +0200\r
+Message-ID: <m238nhlw2p.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 31 Oct 2013 07:49:03 -0000\r
+\r
+On Thu, Oct 31 2013, Ben Gamari <bgamari.foss@gmail.com> wrote:\r
+\r
+> Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>\r
+\r
+LGTM.\r
+\r
+Tomi\r
+\r
+\r
+> ---\r
+>  test/compact      | 32 ++++++++++++++++++++++++++++++++\r
+>  test/notmuch-test |  1 +\r
+>  2 files changed, 33 insertions(+)\r
+>  create mode 100755 test/compact\r
+>\r
+> diff --git a/test/compact b/test/compact\r
+> new file mode 100755\r
+> index 0000000..5bb5cea\r
+> --- /dev/null\r
+> +++ b/test/compact\r
+> @@ -0,0 +1,32 @@\r
+> +#!/usr/bin/env bash\r
+> +test_description='"notmuch compact"'\r
+> +. ./test-lib.sh\r
+> +\r
+> +add_message '[subject]=One'\r
+> +add_message '[subject]=Two'\r
+> +add_message '[subject]=Three'\r
+> +\r
+> +notmuch tag +tag1 \*\r
+> +notmuch tag +tag2 subject:Two\r
+> +notmuch tag -tag1 +tag3 subject:Three\r
+> +\r
+> +test_expect_success "Running compact" "notmuch compact"\r
+> +\r
+> +test_begin_subtest "Compact preserves database"\r
+> +output=$(notmuch search \* | notmuch_search_sanitize)\r
+> +test_expect_equal "$output" "\\r
+> +thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; One (inbox tag1 unread)\r
+> +thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag1 tag2 unread)\r
+> +thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Three (inbox tag3 unread)"\r
+> +\r
+> +test_begin_subtest "Restoring backup"\r
+> +rm -Rf ${TEST_TMPDIR}/mail/xapian\r
+> +mv ${TEST_TMPDIR}/mail/xapian.old ${TEST_TMPDIR}/mail/xapian\r
+> +\r
+> +output=$(notmuch search \* | notmuch_search_sanitize)\r
+> +test_expect_equal "$output" "\\r
+> +thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; One (inbox tag1 unread)\r
+> +thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag1 tag2 unread)\r
+> +thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Three (inbox tag3 unread)"\r
+> +\r
+> +test_done\r
+> diff --git a/test/notmuch-test b/test/notmuch-test\r
+> index aa28bb0..ec94baf 100755\r
+> --- a/test/notmuch-test\r
+> +++ b/test/notmuch-test\r
+> @@ -19,6 +19,7 @@ cd $(dirname "$0")\r
+>  TESTS="\r
+>    basic\r
+>    help-test\r
+> +  compact\r
+>    config\r
+>    setup\r
+>    new\r
+> -- \r
+> 1.8.3.2\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r