[PATCH v7 5/6] test: add tests for notmuch count
authorJani Nikula <jani@nikula.org>
Tue, 15 Nov 2011 20:08:52 +0000 (22:08 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:12 +0000 (09:40 -0800)
77/1ea2985e518070373bf6166bdd4b4252aef923 [new file with mode: 0644]

diff --git a/77/1ea2985e518070373bf6166bdd4b4252aef923 b/77/1ea2985e518070373bf6166bdd4b4252aef923
new file mode 100644 (file)
index 0000000..394ef88
--- /dev/null
@@ -0,0 +1,123 @@
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 2671F429E26\r
+       for <notmuch@notmuchmail.org>; Tue, 15 Nov 2011 12:09:22 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id yccHs0X8qDwn for <notmuch@notmuchmail.org>;\r
+       Tue, 15 Nov 2011 12:09:18 -0800 (PST)\r
+Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com\r
+       [209.85.161.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 17113429E21\r
+       for <notmuch@notmuchmail.org>; Tue, 15 Nov 2011 12:09:17 -0800 (PST)\r
+Received: by mail-fx0-f53.google.com with SMTP id n15so895260faa.26\r
+       for <notmuch@notmuchmail.org>; Tue, 15 Nov 2011 12:09:17 -0800 (PST)\r
+Received: by 10.205.122.17 with SMTP id ge17mr17512204bkc.109.1321387757612;\r
+       Tue, 15 Nov 2011 12:09:17 -0800 (PST)\r
+Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi.\r
+       [80.220.92.23])\r
+       by mx.google.com with ESMTPS id j4sm673015fae.3.2011.11.15.12.09.15\r
+       (version=SSLv3 cipher=OTHER); Tue, 15 Nov 2011 12:09:16 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v7 5/6] test: add tests for notmuch count\r
+Date: Tue, 15 Nov 2011 22:08:52 +0200\r
+Message-Id:\r
+ <2c11a49807dca1d2ed2d386ad21c21aff11969cf.1321386762.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.5.4\r
+In-Reply-To: <cover.1321386762.git.jani@nikula.org>\r
+References: <cover.1321386762.git.jani@nikula.org>\r
+In-Reply-To: <cover.1321386762.git.jani@nikula.org>\r
+References: <cover.1321386762.git.jani@nikula.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 15 Nov 2011 20:09:22 -0000\r
+\r
+Signed-off-by: Jani Nikula <jani@nikula.org>\r
+---\r
+ test/count        |   40 ++++++++++++++++++++++++++++++++++++++++\r
+ test/notmuch-test |    1 +\r
+ 2 files changed, 41 insertions(+), 0 deletions(-)\r
+ create mode 100755 test/count\r
+\r
+diff --git a/test/count b/test/count\r
+new file mode 100755\r
+index 0000000..300b171\r
+--- /dev/null\r
++++ b/test/count\r
+@@ -0,0 +1,40 @@\r
++#!/usr/bin/env bash\r
++test_description='"notmuch count" for messages and threads'\r
++. ./test-lib.sh\r
++\r
++add_email_corpus\r
++\r
++SEARCH="\"*\""\r
++\r
++test_begin_subtest "message count is the default for notmuch count"\r
++test_expect_equal \\r
++    "`notmuch search --output=messages ${SEARCH} | wc -l`" \\r
++    "`notmuch count ${SEARCH}`"\r
++\r
++test_begin_subtest "message count with --output=messages"\r
++test_expect_equal \\r
++    "`notmuch search --output=messages ${SEARCH} | wc -l`" \\r
++    "`notmuch count --output=messages ${SEARCH}`"\r
++\r
++test_begin_subtest "thread count with --output=threads"\r
++test_expect_equal \\r
++    "`notmuch search --output=threads ${SEARCH} | wc -l`" \\r
++    "`notmuch count --output=threads ${SEARCH}`"\r
++\r
++test_begin_subtest "thread count is the default for notmuch search"\r
++test_expect_equal \\r
++    "`notmuch search ${SEARCH} | wc -l`" \\r
++    "`notmuch count --output=threads ${SEARCH}`"\r
++\r
++SEARCH="from:cworth and not from:cworth"\r
++test_begin_subtest "count with no matching messages"\r
++test_expect_equal \\r
++    "0" \\r
++    "`notmuch count --output=messages ${SEARCH}`"\r
++\r
++test_begin_subtest "count with no matching threads"\r
++test_expect_equal \\r
++    "0" \\r
++    "`notmuch count --output=threads ${SEARCH}`"\r
++\r
++test_done\r
+diff --git a/test/notmuch-test b/test/notmuch-test\r
+index bbabf28..29de30d 100755\r
+--- a/test/notmuch-test\r
++++ b/test/notmuch-test\r
+@@ -19,6 +19,7 @@ cd $(dirname "$0")\r
+ TESTS="\r
+   basic\r
+   new\r
++  count\r
+   search\r
+   search-output\r
+   search-by-folder\r
+-- \r
+1.7.5.4\r
+\r