[RFC PATCH v5 03/11] test: add tests for new cli --no-exclude option
authorMark Walters <markwalters1009@gmail.com>
Wed, 15 Feb 2012 09:03:31 +0000 (09:03 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:44:31 +0000 (09:44 -0800)
56/72b23c03102e822c7ced6de110b2ab732d816e [new file with mode: 0644]

diff --git a/56/72b23c03102e822c7ced6de110b2ab732d816e b/56/72b23c03102e822c7ced6de110b2ab732d816e
new file mode 100644 (file)
index 0000000..cd6f59c
--- /dev/null
@@ -0,0 +1,116 @@
+Return-Path: <markwalters1009@gmail.com>\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 513D141ED7C\r
+       for <notmuch@notmuchmail.org>; Wed, 15 Feb 2012 01:03:13 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       RCVD_IN_DNSWL_LOW=-0.7] 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 MYzuUbSl8HHL for <notmuch@notmuchmail.org>;\r
+       Wed, 15 Feb 2012 01:03:11 -0800 (PST)\r
+Received: from mail-we0-f181.google.com (mail-we0-f181.google.com\r
+       [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id B5FCB421163\r
+       for <notmuch@notmuchmail.org>; Wed, 15 Feb 2012 01:02:59 -0800 (PST)\r
+Received: by mail-we0-f181.google.com with SMTP id p13so603332wer.26\r
+       for <notmuch@notmuchmail.org>; Wed, 15 Feb 2012 01:02:59 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=fN7XN3hi51DAGN4YfZOUofu3diawcjE5kNxzwiGd8sI=;\r
+       b=spHMO+5cW0Hz7S7HVF81GwRmLZtL6wT3eaXcO24ZzWtVd4lJbZFe7LlI52r7kYtV52\r
+       P6XhgwWevJWQyKLyoGdq8fBQWFJgjWEIWPVXCB6p3+5IezjasT3rwDe7Z16etAsCEmM6\r
+       XxUtvDUeZKMWgFyv6FaTGkT2mgWogfiTS7jgg=\r
+Received: by 10.180.24.202 with SMTP id w10mr34037466wif.9.1329296579499;\r
+       Wed, 15 Feb 2012 01:02:59 -0800 (PST)\r
+Received: from localhost (94-192-233-223.zone6.bethere.co.uk.\r
+ [94.192.233.223])     by mx.google.com with ESMTPS id\r
+ y6sm32086931wix.10.2012.02.15.01.02.57        (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Wed, 15 Feb 2012 01:02:58 -0800 (PST)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [RFC PATCH v5 03/11] test: add tests for new cli --no-exclude option\r
+Date: Wed, 15 Feb 2012 09:03:31 +0000\r
+Message-Id: <1329296619-7463-4-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.2.3\r
+In-Reply-To: <1329296619-7463-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1329296619-7463-1-git-send-email-markwalters1009@gmail.com>\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: Wed, 15 Feb 2012 09:03:13 -0000\r
+\r
+The tests test the new --no-exclude option to search and count.\r
+There were no existing tests for the exclude behaviour for count so\r
+added these too.\r
+---\r
+ test/count  |   21 +++++++++++++++++++++\r
+ test/search |    5 +++++\r
+ 2 files changed, 26 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/test/count b/test/count\r
+index 300b171..976fff1 100755\r
+--- a/test/count\r
++++ b/test/count\r
+@@ -37,4 +37,25 @@ test_expect_equal \\r
+     "0" \\r
+     "`notmuch count --output=threads ${SEARCH}`"\r
+ \r
++test_begin_subtest "count excluding \"deleted\" messages"\r
++notmuch config set search.exclude_tags = deleted\r
++generate_message '[subject]="Not deleted"'\r
++generate_message '[subject]="Another not deleted"'\r
++generate_message '[subject]="Deleted"'\r
++notmuch new > /dev/null\r
++notmuch tag +deleted id:$gen_msg_id\r
++test_expect_equal \\r
++    "2" \\r
++    "`notmuch count subject:deleted`"\r
++\r
++test_begin_subtest "count \"deleted\" messages, exclude overridden"\r
++test_expect_equal \\r
++    "1" \\r
++    "`notmuch count subject:deleted and tag:deleted`"\r
++\r
++test_begin_subtest "count \"deleted\" messages, with --no-exclude"\r
++test_expect_equal \\r
++    "3" \\r
++    "`notmuch count --no-exclude subject:deleted`"\r
++\r
+ test_done\r
+diff --git a/test/search b/test/search\r
+index 414be35..3da5d17 100755\r
+--- a/test/search\r
++++ b/test/search\r
+@@ -148,6 +148,11 @@ output=$(notmuch search subject:deleted | notmuch_search_sanitize)\r
+ test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread)\r
+ thread:XXX   2001-01-05 [1/2] Notmuch Test Suite; Not deleted reply (deleted inbox unread)"\r
+ \r
++test_begin_subtest "Don't exclude \"deleted\" messages when --no-exclude specified"\r
++output=$(notmuch search --no-exclude subject:deleted | notmuch_search_sanitize)\r
++test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread)\r
++thread:XXX   2001-01-05 [2/2] Notmuch Test Suite; Deleted (deleted inbox unread)"\r
++\r
+ test_begin_subtest "Don't exclude \"deleted\" messages from search if not configured"\r
+ notmuch config set search.exclude_tags\r
+ output=$(notmuch search subject:deleted | notmuch_search_sanitize)\r
+-- \r
+1.7.2.3\r
+\r