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 5FDED429E3F for ; Sun, 6 Nov 2011 13:47:51 -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 ejYWwa6CINVK for ; Sun, 6 Nov 2011 13:47:50 -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 E06B9429E43 for ; Sun, 6 Nov 2011 13:47:36 -0800 (PST) Received: by mail-fx0-f53.google.com with SMTP id n15so1762114faa.26 for ; Sun, 06 Nov 2011 13:47:36 -0800 (PST) Received: by 10.223.7.14 with SMTP id b14mr43084646fab.10.1320616056450; Sun, 06 Nov 2011 13:47:36 -0800 (PST) Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi. [80.220.92.23]) by mx.google.com with ESMTPS id l26sm28473179fad.17.2011.11.06.13.47.34 (version=SSLv3 cipher=OTHER); Sun, 06 Nov 2011 13:47:35 -0800 (PST) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [PATCH v4 5/6] test: add tests for notmuch count Date: Sun, 6 Nov 2011 23:47:14 +0200 Message-Id: <582edd7c54d30677ae490fea8ed5da32542e2204.1320615322.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, 06 Nov 2011 21:47:52 -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