From: Ben Gamari Date: Sun, 27 Oct 2013 20:30:05 +0000 (+2000) Subject: [PATCH 1/3] test: Add compact test X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e4d0dc87525f2f8dfd2ee63d0f48f736da040eb7;p=notmuch-archives.git [PATCH 1/3] test: Add compact test --- diff --git a/99/d8576ef49a457d4a6bf066c70421cc3c17c34f b/99/d8576ef49a457d4a6bf066c70421cc3c17c34f new file mode 100644 index 000000000..a384f2c0b --- /dev/null +++ b/99/d8576ef49a457d4a6bf066c70421cc3c17c34f @@ -0,0 +1,124 @@ +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 5BE3A429E44 + for ; Sun, 27 Oct 2013 13:30:23 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 vghb8JEe7-1M for ; + Sun, 27 Oct 2013 13:30:18 -0700 (PDT) +Received: from mail-qa0-f48.google.com (mail-qa0-f48.google.com + [209.85.216.48]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 31C6D431FDA + for ; Sun, 27 Oct 2013 13:30:18 -0700 (PDT) +Received: by mail-qa0-f48.google.com with SMTP id k4so1698011qaq.14 + for ; Sun, 27 Oct 2013 13:30:17 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id; + bh=AGdUOLDlmRscfTbD7v1hQxh0Ss9J0Kiu5LV2eJ7vLrU=; + b=oBVE+ZMGOjMsNUaQdA0z64LxRxxxZiI8QAeaRGKF+fZRloLUfM0Y8+iQvUpt4dHkz7 + pn5TYWQtmvJiLirWtm+fFfRWjtBv+0RTUWy5EU/uJZI5fr7S2EiEmLzMyaq6MDAlZoNb + /ZSmRmjJNvQ1miRX4LIRY9hPY7js0wDnr57xRhvFwVkuTGI9yUOSdM9GQ5CUjnUiYfcE + E2WosGMssU8ePTCq+Ly7cs7KCS4ePWSiL5xQ6ENqq4iVOJiPvnUizI7Pb4EUmfkEr2xr + WFkGUtu6PQymiIeRjGWpICHkQyaStdTNFlRBcZrNcp/0BZOGtYE4iiBPsy085naeWlqL + zW4w== +X-Received: by 10.49.127.179 with SMTP id nh19mr24500643qeb.1.1382905817620; + Sun, 27 Oct 2013 13:30:17 -0700 (PDT) +Received: from localhost.localdomain + (pool-96-240-254-51.spfdma.east.verizon.net. [96.240.254.51]) + by mx.google.com with ESMTPSA id x1sm45270525qai.6.2013.10.27.13.30.16 + for + (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); + Sun, 27 Oct 2013 13:30:17 -0700 (PDT) +From: Ben Gamari +To: notmuch@notmuchmail.org +Subject: [PATCH 1/3] test: Add compact test +Date: Sun, 27 Oct 2013 16:30:05 -0400 +Message-Id: <1382905807-22220-1-git-send-email-bgamari.foss@gmail.com> +X-Mailer: git-send-email 1.8.3.2 +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, 27 Oct 2013 20:30:23 -0000 + +Signed-off-by: Ben Gamari +--- + test/compact | 35 +++++++++++++++++++++++++++++++++++ + test/notmuch-test | 1 + + 2 files changed, 36 insertions(+) + create mode 100755 test/compact + +diff --git a/test/compact b/test/compact +new file mode 100755 +index 0000000..54e85ab +--- /dev/null ++++ b/test/compact +@@ -0,0 +1,35 @@ ++#!/usr/bin/env bash ++test_description='"notmuch compact"' ++. ./test-lib.sh ++ ++add_message '[subject]=One' ++add_message '[subject]=Two' ++add_message '[subject]=Three' ++ ++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" ++ ++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:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag1 tag2 unread) ++thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Three (inbox tag3 unread)" ++ ++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:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag1 tag2 unread) ++thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Three (inbox tag3 unread)" ++ ++test_done +diff --git a/test/notmuch-test b/test/notmuch-test +index aa28bb0..ec94baf 100755 +--- a/test/notmuch-test ++++ b/test/notmuch-test +@@ -19,6 +19,7 @@ cd $(dirname "$0") + TESTS=" + basic + help-test ++ compact + config + setup + new +-- +1.8.3.2 +