From 8fad1b6ca29604416e501b6a7e369e99ee3dfdde Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Wed, 15 Feb 2012 09:03:31 +0000 Subject: [PATCH] [RFC PATCH v5 03/11] test: add tests for new cli --no-exclude option --- 56/72b23c03102e822c7ced6de110b2ab732d816e | 116 ++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 56/72b23c03102e822c7ced6de110b2ab732d816e diff --git a/56/72b23c03102e822c7ced6de110b2ab732d816e b/56/72b23c03102e822c7ced6de110b2ab732d816e new file mode 100644 index 000000000..cd6f59c9e --- /dev/null +++ b/56/72b23c03102e822c7ced6de110b2ab732d816e @@ -0,0 +1,116 @@ +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 513D141ED7C + for ; Wed, 15 Feb 2012 01:03:13 -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 MYzuUbSl8HHL for ; + Wed, 15 Feb 2012 01:03:11 -0800 (PST) +Received: from mail-we0-f181.google.com (mail-we0-f181.google.com + [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id B5FCB421163 + for ; Wed, 15 Feb 2012 01:02:59 -0800 (PST) +Received: by mail-we0-f181.google.com with SMTP id p13so603332wer.26 + for ; Wed, 15 Feb 2012 01:02:59 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; + h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; + bh=fN7XN3hi51DAGN4YfZOUofu3diawcjE5kNxzwiGd8sI=; + b=spHMO+5cW0Hz7S7HVF81GwRmLZtL6wT3eaXcO24ZzWtVd4lJbZFe7LlI52r7kYtV52 + P6XhgwWevJWQyKLyoGdq8fBQWFJgjWEIWPVXCB6p3+5IezjasT3rwDe7Z16etAsCEmM6 + XxUtvDUeZKMWgFyv6FaTGkT2mgWogfiTS7jgg= +Received: by 10.180.24.202 with SMTP id w10mr34037466wif.9.1329296579499; + Wed, 15 Feb 2012 01:02:59 -0800 (PST) +Received: from localhost (94-192-233-223.zone6.bethere.co.uk. + [94.192.233.223]) by mx.google.com with ESMTPS id + y6sm32086931wix.10.2012.02.15.01.02.57 (version=TLSv1/SSLv3 cipher=OTHER); + Wed, 15 Feb 2012 01:02:58 -0800 (PST) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [RFC PATCH v5 03/11] test: add tests for new cli --no-exclude option +Date: Wed, 15 Feb 2012 09:03:31 +0000 +Message-Id: <1329296619-7463-4-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.2.3 +In-Reply-To: <1329296619-7463-1-git-send-email-markwalters1009@gmail.com> +References: <1329296619-7463-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: Wed, 15 Feb 2012 09:03:13 -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 + -- 2.26.2