[PATCH v3 5/7] test: add tests for notmuch count
authorJani Nikula <jani@nikula.org>
Fri, 4 Nov 2011 20:25:13 +0000 (22:25 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:39:59 +0000 (09:39 -0800)
3d/c6b2ac76a89d9a17642396bb2bbdc4cb11f2b9 [new file with mode: 0644]

diff --git a/3d/c6b2ac76a89d9a17642396bb2bbdc4cb11f2b9 b/3d/c6b2ac76a89d9a17642396bb2bbdc4cb11f2b9
new file mode 100644 (file)
index 0000000..37b36ec
--- /dev/null
@@ -0,0 +1,124 @@
+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 A9009429E31\r
+       for <notmuch@notmuchmail.org>; Fri,  4 Nov 2011 13:25:31 -0700 (PDT)\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 cYfeKW8Smc9j for <notmuch@notmuchmail.org>;\r
+       Fri,  4 Nov 2011 13:25:31 -0700 (PDT)\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 202E4429E2F\r
+       for <notmuch@notmuchmail.org>; Fri,  4 Nov 2011 13:25:30 -0700 (PDT)\r
+Received: by mail-fx0-f53.google.com with SMTP id n15so52582faa.26\r
+       for <notmuch@notmuchmail.org>; Fri, 04 Nov 2011 13:25:29 -0700 (PDT)\r
+Received: by 10.223.77.66 with SMTP id f2mr26251242fak.24.1320438329514;\r
+       Fri, 04 Nov 2011 13:25:29 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi.\r
+       [80.220.92.23])\r
+       by mx.google.com with ESMTPS id l26sm18277134fad.17.2011.11.04.13.25.28\r
+       (version=SSLv3 cipher=OTHER); Fri, 04 Nov 2011 13:25:29 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v3 5/7] test: add tests for notmuch count\r
+Date: Fri,  4 Nov 2011 22:25:13 +0200\r
+Message-Id:\r
+ <0a273fb12ba036646530ba4b9005e96ff0e2d0d3.1320349030.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.5.4\r
+In-Reply-To: <cover.1320349030.git.jani@nikula.org>\r
+References: <cover.1320349030.git.jani@nikula.org>\r
+In-Reply-To: <cover.1320349030.git.jani@nikula.org>\r
+References: <cover.1320349030.git.jani@nikula.org>\r
+Cc: amdragon@mit.edu\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: Fri, 04 Nov 2011 20:25:31 -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 738f8f6..587adb5 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