From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id BBAC6431FAE for ; Thu, 1 Mar 2012 14:29:16 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.201 X-Spam-Level: X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=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 y0HW9aCnV2Oa for ; Thu, 1 Mar 2012 14:29:16 -0800 (PST) Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 0CC2F431E64 for ; Thu, 1 Mar 2012 14:29:12 -0800 (PST) Received: by mail-ww0-f45.google.com with SMTP id dt12so108365wgb.2 for ; Thu, 01 Mar 2012 14:29:12 -0800 (PST) Received-SPF: pass (google.com: domain of markwalters1009@gmail.com designates 10.180.101.228 as permitted sender) client-ip=10.180.101.228; Authentication-Results: mr.google.com; spf=pass (google.com: domain of markwalters1009@gmail.com designates 10.180.101.228 as permitted sender) smtp.mail=markwalters1009@gmail.com; dkim=pass header.i=markwalters1009@gmail.com Received: from mr.google.com ([10.180.101.228]) by 10.180.101.228 with SMTP id fj4mr6555579wib.4.1330640952874 (num_hops = 1); Thu, 01 Mar 2012 14:29:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=fN7XN3hi51DAGN4YfZOUofu3diawcjE5kNxzwiGd8sI=; b=mFLMpghc6LuJlz0Ik+QzC/GcDA6AsRs9aS10sXakAwcj3aBanViIEviDlYepYfPaBP 6tFk1fC9GZL3upqEBAWjj9awi7o5TNN0PJDBbHmGz0iFh+6wE4Bm9gKE3l7ExIGBWAvm D2mOhen0LNbBWqcRcMZwlwVsSRUlu4eBc8rvQckEU7vysNjacOPYIznLMCzlkTNhMocI kh1KLwRuph8qDUhi/By0NW5T4rNIa0UT9tXcJQDMhrUfFwBaXiKEraNWVEzTtQ84Wd3c U3VwHGH8/XEBzRV/6s+o+/helGHkOkx0xisbWwejwdHRAlirP/Rtob6VKSEA3dp37mxe poPg== Received: by 10.180.101.228 with SMTP id fj4mr5292226wib.4.1330640952815; Thu, 01 Mar 2012 14:29:12 -0800 (PST) Received: from localhost (94-192-233-223.zone6.bethere.co.uk. [94.192.233.223]) by mx.google.com with ESMTPS id 9sm16611870wid.2.2012.03.01.14.29.10 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 01 Mar 2012 14:29:11 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org Subject: [Patch v7 03/13] test: add tests for new cli --no-exclude option Date: Thu, 1 Mar 2012 22:30:35 +0000 Message-Id: <1330641045-27416-4-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1330641045-27416-1-git-send-email-markwalters1009@gmail.com> References: <1330641045-27416-1-git-send-email-markwalters1009@gmail.com> 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: Thu, 01 Mar 2012 22:29:17 -0000 The tests test the new --no-exclude option to search and count. There were no existing tests for the exclude behaviour for count so added these too. --- test/count | 21 +++++++++++++++++++++ test/search | 5 +++++ 2 files changed, 26 insertions(+), 0 deletions(-) diff --git a/test/count b/test/count index 300b171..976fff1 100755 --- a/test/count +++ b/test/count @@ -37,4 +37,25 @@ test_expect_equal \ "0" \ "`notmuch count --output=threads ${SEARCH}`" +test_begin_subtest "count excluding \"deleted\" messages" +notmuch config set search.exclude_tags = deleted +generate_message '[subject]="Not deleted"' +generate_message '[subject]="Another not deleted"' +generate_message '[subject]="Deleted"' +notmuch new > /dev/null +notmuch tag +deleted id:$gen_msg_id +test_expect_equal \ + "2" \ + "`notmuch count subject:deleted`" + +test_begin_subtest "count \"deleted\" messages, exclude overridden" +test_expect_equal \ + "1" \ + "`notmuch count subject:deleted and tag:deleted`" + +test_begin_subtest "count \"deleted\" messages, with --no-exclude" +test_expect_equal \ + "3" \ + "`notmuch count --no-exclude subject:deleted`" + test_done diff --git a/test/search b/test/search index 414be35..3da5d17 100755 --- a/test/search +++ b/test/search @@ -148,6 +148,11 @@ output=$(notmuch search subject:deleted | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread) thread:XXX 2001-01-05 [1/2] Notmuch Test Suite; Not deleted reply (deleted inbox unread)" +test_begin_subtest "Don't exclude \"deleted\" messages when --no-exclude specified" +output=$(notmuch search --no-exclude subject:deleted | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread) +thread:XXX 2001-01-05 [2/2] Notmuch Test Suite; Deleted (deleted inbox unread)" + test_begin_subtest "Don't exclude \"deleted\" messages from search if not configured" notmuch config set search.exclude_tags output=$(notmuch search subject:deleted | notmuch_search_sanitize) -- 1.7.2.3