--- /dev/null
+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 BBAC6431FAE\r
+ for <notmuch@notmuchmail.org>; Thu, 1 Mar 2012 14:29:16 -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 y0HW9aCnV2Oa for <notmuch@notmuchmail.org>;\r
+ Thu, 1 Mar 2012 14:29:16 -0800 (PST)\r
+Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com\r
+ [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client\r
+ certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
+ 0CC2F431E64 for <notmuch@notmuchmail.org>; Thu, 1 Mar 2012 14:29:12 -0800\r
+ (PST)\r
+Received: by mail-ww0-f45.google.com with SMTP id dt12so108365wgb.2\r
+ for <notmuch@notmuchmail.org>; Thu, 01 Mar 2012 14:29:12 -0800 (PST)\r
+Received-SPF: pass (google.com: domain of markwalters1009@gmail.com designates\r
+ 10.180.101.228 as permitted sender) client-ip=10.180.101.228; \r
+Authentication-Results: mr.google.com; spf=pass (google.com: domain of\r
+ markwalters1009@gmail.com designates 10.180.101.228 as\r
+ permitted sender) smtp.mail=markwalters1009@gmail.com;\r
+ dkim=pass header.i=markwalters1009@gmail.com\r
+Received: from mr.google.com ([10.180.101.228])\r
+ by 10.180.101.228 with SMTP id fj4mr6555579wib.4.1330640952874\r
+ (num_hops = 1); Thu, 01 Mar 2012 14:29:12 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+ bh=fN7XN3hi51DAGN4YfZOUofu3diawcjE5kNxzwiGd8sI=;\r
+ b=mFLMpghc6LuJlz0Ik+QzC/GcDA6AsRs9aS10sXakAwcj3aBanViIEviDlYepYfPaBP\r
+ 6tFk1fC9GZL3upqEBAWjj9awi7o5TNN0PJDBbHmGz0iFh+6wE4Bm9gKE3l7ExIGBWAvm\r
+ D2mOhen0LNbBWqcRcMZwlwVsSRUlu4eBc8rvQckEU7vysNjacOPYIznLMCzlkTNhMocI\r
+ kh1KLwRuph8qDUhi/By0NW5T4rNIa0UT9tXcJQDMhrUfFwBaXiKEraNWVEzTtQ84Wd3c\r
+ U3VwHGH8/XEBzRV/6s+o+/helGHkOkx0xisbWwejwdHRAlirP/Rtob6VKSEA3dp37mxe\r
+ poPg==\r
+Received: by 10.180.101.228 with SMTP id fj4mr5292226wib.4.1330640952815;\r
+ Thu, 01 Mar 2012 14:29:12 -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
+ 9sm16611870wid.2.2012.03.01.14.29.10 (version=TLSv1/SSLv3 cipher=OTHER); Thu,\r
+ 01 Mar 2012 14:29:11 -0800 (PST)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [Patch v7 03/13] test: add tests for new cli --no-exclude option\r
+Date: Thu, 1 Mar 2012 22:30:35 +0000\r
+Message-Id: <1330641045-27416-4-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.2.3\r
+In-Reply-To: <1330641045-27416-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1330641045-27416-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: Thu, 01 Mar 2012 22:29:17 -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