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 7390A429E30 for ; Sun, 13 Nov 2011 11:49:20 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[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 v9PnIFAEZfSt for ; Sun, 13 Nov 2011 11:49:19 -0800 (PST) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 2E0A9429E47 for ; Sun, 13 Nov 2011 11:49:05 -0800 (PST) Received: by mail-bw0-f53.google.com with SMTP id q10so6225076bka.26 for ; Sun, 13 Nov 2011 11:49:04 -0800 (PST) Received: by 10.205.119.11 with SMTP id fs11mr16538820bkc.58.1321213744694; Sun, 13 Nov 2011 11:49:04 -0800 (PST) Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi. [80.220.92.23]) by mx.google.com with ESMTPS id f14sm4684268bkv.3.2011.11.13.11.49.02 (version=SSLv3 cipher=OTHER); Sun, 13 Nov 2011 11:49:03 -0800 (PST) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [PATCH v5 5/6] test: add tests for notmuch count Date: Sun, 13 Nov 2011 21:48:39 +0200 Message-Id: <55e05d2537085e15dcc9206ba3b3ab1134d254b2.1321212673.git.jani@nikula.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: References: In-Reply-To: References: 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, 13 Nov 2011 19:49:20 -0000 Signed-off-by: Jani Nikula --- test/count | 40 ++++++++++++++++++++++++++++++++++++++++ test/notmuch-test | 1 + 2 files changed, 41 insertions(+), 0 deletions(-) create mode 100755 test/count diff --git a/test/count b/test/count new file mode 100755 index 0000000..300b171 --- /dev/null +++ b/test/count @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +test_description='"notmuch count" for messages and threads' +. ./test-lib.sh + +add_email_corpus + +SEARCH="\"*\"" + +test_begin_subtest "message count is the default for notmuch count" +test_expect_equal \ + "`notmuch search --output=messages ${SEARCH} | wc -l`" \ + "`notmuch count ${SEARCH}`" + +test_begin_subtest "message count with --output=messages" +test_expect_equal \ + "`notmuch search --output=messages ${SEARCH} | wc -l`" \ + "`notmuch count --output=messages ${SEARCH}`" + +test_begin_subtest "thread count with --output=threads" +test_expect_equal \ + "`notmuch search --output=threads ${SEARCH} | wc -l`" \ + "`notmuch count --output=threads ${SEARCH}`" + +test_begin_subtest "thread count is the default for notmuch search" +test_expect_equal \ + "`notmuch search ${SEARCH} | wc -l`" \ + "`notmuch count --output=threads ${SEARCH}`" + +SEARCH="from:cworth and not from:cworth" +test_begin_subtest "count with no matching messages" +test_expect_equal \ + "0" \ + "`notmuch count --output=messages ${SEARCH}`" + +test_begin_subtest "count with no matching threads" +test_expect_equal \ + "0" \ + "`notmuch count --output=threads ${SEARCH}`" + +test_done diff --git a/test/notmuch-test b/test/notmuch-test index 738f8f6..587adb5 100755 --- a/test/notmuch-test +++ b/test/notmuch-test @@ -19,6 +19,7 @@ cd $(dirname "$0") TESTS=" basic new + count search search-output search-by-folder -- 1.7.5.4