From: Mark Walters Date: Sat, 25 Feb 2012 08:06:34 +0000 (+0000) Subject: [Patch v6 03/13] test: add tests for new cli --no-exclude option X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=87f17c3d3c0f28fcb6015a9c9d09f3b3fd769199;p=notmuch-archives.git [Patch v6 03/13] test: add tests for new cli --no-exclude option --- diff --git a/e0/22ab0a3f0ac36554cb247d213c9e44f2c4884c b/e0/22ab0a3f0ac36554cb247d213c9e44f2c4884c new file mode 100644 index 000000000..f29ed183c --- /dev/null +++ b/e0/22ab0a3f0ac36554cb247d213c9e44f2c4884c @@ -0,0 +1,126 @@ +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 DA9C6431FBD + for ; Sat, 25 Feb 2012 22:14:32 -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 tjEoas0S618K for ; + Sat, 25 Feb 2012 22:14:32 -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 + 3A8CF431FAE for ; Sat, 25 Feb 2012 22:14:32 -0800 + (PST) +Received: by wgbdt12 with SMTP id dt12so2830429wgb.2 + for ; Sat, 25 Feb 2012 22:14:31 -0800 (PST) +Received-SPF: pass (google.com: domain of markwalters1009@gmail.com designates + 10.180.90.225 as permitted sender) client-ip=10.180.90.225; +Authentication-Results: mr.google.com; spf=pass (google.com: domain of + markwalters1009@gmail.com designates 10.180.90.225 as permitted + sender) smtp.mail=markwalters1009@gmail.com; + dkim=pass header.i=markwalters1009@gmail.com +Received: from mr.google.com ([10.180.90.225]) + by 10.180.90.225 with SMTP id bz1mr8529762wib.5.1330236871175 (num_hops + = 1); Sat, 25 Feb 2012 22:14:31 -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=Nnaz8AEtAv8BbKB73bhclbku/9K2hTVQH+YMXGw0mPCRxv7L9Py9mWqtDuGOaMdqls + KSZONmGOMkmV3+1xFjeryX3oHufkPDsGYq8W17SIYeRf9Ni40Bmlg/dkR7HMXP+Ma4vt + DScI+Bt0SxkDNBAT8kFNEEAf+2jJ6W9bDGkRg= +Received: by 10.180.90.225 with SMTP id bz1mr1783752wib.5.1330157131886; + Sat, 25 Feb 2012 00:05:31 -0800 (PST) +Received: from localhost (94-192-233-223.zone6.bethere.co.uk. + [94.192.233.223]) by mx.google.com with ESMTPS id + s4sm13026163wiy.5.2012.02.25.00.05.30 (version=TLSv1/SSLv3 cipher=OTHER); + Sat, 25 Feb 2012 00:05:31 -0800 (PST) +From: Mark Walters +To: notmuch@notmuchmail.org, + Austin Clements +Subject: [Patch v6 03/13] test: add tests for new cli --no-exclude option +Date: Sat, 25 Feb 2012 08:06:34 +0000 +Message-Id: <1330157204-26094-4-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.2.3 +In-Reply-To: <1330157204-26094-1-git-send-email-markwalters1009@gmail.com> +References: <1330157204-26094-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: Sun, 26 Feb 2012 06:14:33 -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 +