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 2671F429E26 for ; Tue, 15 Nov 2011 12:09:22 -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 yccHs0X8qDwn for ; Tue, 15 Nov 2011 12:09:18 -0800 (PST) Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com [209.85.161.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 17113429E21 for ; Tue, 15 Nov 2011 12:09:17 -0800 (PST) Received: by mail-fx0-f53.google.com with SMTP id n15so895260faa.26 for ; Tue, 15 Nov 2011 12:09:17 -0800 (PST) Received: by 10.205.122.17 with SMTP id ge17mr17512204bkc.109.1321387757612; Tue, 15 Nov 2011 12:09:17 -0800 (PST) Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi. [80.220.92.23]) by mx.google.com with ESMTPS id j4sm673015fae.3.2011.11.15.12.09.15 (version=SSLv3 cipher=OTHER); Tue, 15 Nov 2011 12:09:16 -0800 (PST) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [PATCH v7 5/6] test: add tests for notmuch count Date: Tue, 15 Nov 2011 22:08:52 +0200 Message-Id: <2c11a49807dca1d2ed2d386ad21c21aff11969cf.1321386762.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: Tue, 15 Nov 2011 20:09:22 -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 bbabf28..29de30d 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