--- /dev/null
+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 7C1EA431FD7\r
+ for <notmuch@notmuchmail.org>; Sat, 9 Mar 2013 07:13:05 -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 EjE0f9c2yujv for <notmuch@notmuchmail.org>;\r
+ Sat, 9 Mar 2013 07:13:04 -0800 (PST)\r
+Received: from mail-la0-f43.google.com (mail-la0-f43.google.com\r
+ [209.85.215.43]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 031A1431FAF\r
+ for <notmuch@notmuchmail.org>; Sat, 9 Mar 2013 07:12:52 -0800 (PST)\r
+Received: by mail-la0-f43.google.com with SMTP id ek20so2623871lab.30\r
+ for <notmuch@notmuchmail.org>; Sat, 09 Mar 2013 07:12:51 -0800 (PST)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=google.com; s=20120113;\r
+ h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to\r
+ :references:in-reply-to:references:x-gm-message-state;\r
+ bh=iUkysQufjsRsiFiizusF6lYFGKXmYlhr58F+m8UjVsI=;\r
+ b=HohhV9W/PxY1yeCqxMB49EJUxPb8nr3bv4XCn7haiHVAehc+WD/N7SxgWtK97SVi7U\r
+ EwGlhLWmS0Fo+pQ6tF2TqtQQGTMA7dss4rgo1OjxC6NupeRml4zYQbGPLTEIrJGLj8ph\r
+ eZJ/HEVB0E0/YZsbgwxrWtJZgCSv4qd1SzGOWgxMIPKyMqUK3xtOmOTrGHTZF4by2Aau\r
+ whMWilCRhm63Ce7heAVJ4hWGHEoQ/IAKulsQokNL95boErDxhiAhvdBRy8/QGqNXksBr\r
+ 03azgjw69OG3YNKWoceb3KY0LgHX3gH7T85nAGCjp1rP/jditPRtXaphs7LI0VeArsnS\r
+ UH5w==\r
+X-Received: by 10.152.110.167 with SMTP id ib7mr5242562lab.22.1362841971491;\r
+ Sat, 09 Mar 2013 07:12:51 -0800 (PST)\r
+Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi.\r
+ [80.223.81.27])\r
+ by mx.google.com with ESMTPS id xw14sm4275762lab.6.2013.03.09.07.12.49\r
+ (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+ Sat, 09 Mar 2013 07:12:50 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 5/6] test: notmuch count --batch and --input options\r
+Date: Sat, 9 Mar 2013 17:12:25 +0200\r
+Message-Id:\r
+ <78b80f73ba645bf2e5b0f4569edf22ffd3a5d4c4.1362841844.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <cover.1362841844.git.jani@nikula.org>\r
+References: <cover.1362841844.git.jani@nikula.org>\r
+In-Reply-To: <cover.1362841844.git.jani@nikula.org>\r
+References: <cover.1362841844.git.jani@nikula.org>\r
+X-Gm-Message-State:\r
+ ALoCoQk0LwnhTk2aigb8FMBW20ViIUrvn0dfsINmrGAtic4ogeD7OdeoLyUdzmwwbVrPI+KjEh70\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: Sat, 09 Mar 2013 15:13:06 -0000\r
+\r
+---\r
+ test/count | 46 ++++++++++++++++++++++++++++++++++++++++++++++\r
+ 1 file changed, 46 insertions(+)\r
+\r
+diff --git a/test/count b/test/count\r
+index 879b114..05713fd 100755\r
+--- a/test/count\r
++++ b/test/count\r
+@@ -38,4 +38,50 @@ test_expect_equal \\r
+ "0" \\r
+ "`notmuch count --output=threads from:cworth and not from:cworth`"\r
+ \r
++test_begin_subtest "message count is the default for batch count"\r
++notmuch count --batch >OUTPUT <<EOF\r
++\r
++from:cworth\r
++EOF\r
++notmuch count --output=messages >EXPECTED\r
++notmuch count --output=messages from:cworth >>EXPECTED\r
++test_expect_equal_file EXPECTED OUTPUT\r
++\r
++test_begin_subtest "batch message count"\r
++notmuch count --batch --output=messages >OUTPUT <<EOF\r
++from:cworth\r
++\r
++tag:inbox\r
++EOF\r
++notmuch count --output=messages from:cworth >EXPECTED\r
++notmuch count --output=messages >>EXPECTED\r
++notmuch count --output=messages tag:inbox >>EXPECTED\r
++test_expect_equal_file EXPECTED OUTPUT\r
++\r
++test_begin_subtest "batch thread count"\r
++notmuch count --batch --output=threads >OUTPUT <<EOF\r
++\r
++from:cworth\r
++from:cworth and not from:cworth\r
++foo\r
++EOF\r
++notmuch count --output=threads >EXPECTED\r
++notmuch count --output=threads from:cworth >>EXPECTED\r
++notmuch count --output=threads from:cworth and not from:cworth >>EXPECTED\r
++notmuch count --output=threads foo >>EXPECTED\r
++test_expect_equal_file EXPECTED OUTPUT\r
++\r
++test_begin_subtest "batch message count with input file"\r
++cat >INPUT <<EOF\r
++from:cworth\r
++\r
++tag:inbox\r
++EOF\r
++notmuch count --input=INPUT --output=messages >OUTPUT\r
++notmuch count --output=messages from:cworth >EXPECTED\r
++notmuch count --output=messages >>EXPECTED\r
++notmuch count --output=messages tag:inbox >>EXPECTED\r
++test_expect_equal_file EXPECTED OUTPUT\r
++\r
++\r
+ test_done\r
+-- \r
+1.7.10.4\r
+\r