unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jani Nikula <jani@nikula.org>
To: notmuch@notmuchmail.org
Cc: Tomi Ollila <tomi.ollila@iki.fi>
Subject: [PATCH v3 5/6] test: notmuch count --batch and --input options
Date: Sun, 31 Mar 2013 12:46:02 +0300	[thread overview]
Message-ID: <b425e543ab3fabb51e9cc88fd6faee2c9433c636.1364722841.git.jani@nikula.org> (raw)
In-Reply-To: <cover.1364722841.git.jani@nikula.org>
In-Reply-To: <cover.1364722841.git.jani@nikula.org>

---
 test/count |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/test/count b/test/count
index 879b114..05713fd 100755
--- a/test/count
+++ b/test/count
@@ -38,4 +38,50 @@ test_expect_equal \
     "0" \
     "`notmuch count --output=threads from:cworth and not from:cworth`"
 
+test_begin_subtest "message count is the default for batch count"
+notmuch count --batch >OUTPUT <<EOF
+
+from:cworth
+EOF
+notmuch count --output=messages >EXPECTED
+notmuch count --output=messages from:cworth >>EXPECTED
+test_expect_equal_file EXPECTED OUTPUT
+
+test_begin_subtest "batch message count"
+notmuch count --batch --output=messages >OUTPUT <<EOF
+from:cworth
+
+tag:inbox
+EOF
+notmuch count --output=messages from:cworth >EXPECTED
+notmuch count --output=messages >>EXPECTED
+notmuch count --output=messages tag:inbox >>EXPECTED
+test_expect_equal_file EXPECTED OUTPUT
+
+test_begin_subtest "batch thread count"
+notmuch count --batch --output=threads >OUTPUT <<EOF
+
+from:cworth
+from:cworth and not from:cworth
+foo
+EOF
+notmuch count --output=threads >EXPECTED
+notmuch count --output=threads from:cworth >>EXPECTED
+notmuch count --output=threads from:cworth and not from:cworth >>EXPECTED
+notmuch count --output=threads foo >>EXPECTED
+test_expect_equal_file EXPECTED OUTPUT
+
+test_begin_subtest "batch message count with input file"
+cat >INPUT <<EOF
+from:cworth
+
+tag:inbox
+EOF
+notmuch count --input=INPUT --output=messages >OUTPUT
+notmuch count --output=messages from:cworth >EXPECTED
+notmuch count --output=messages >>EXPECTED
+notmuch count --output=messages tag:inbox >>EXPECTED
+test_expect_equal_file EXPECTED OUTPUT
+
+
 test_done
-- 
1.7.10.4

  parent reply	other threads:[~2013-03-31  9:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-31  9:45 [PATCH v3 0/6] batch count for notmuch-hello speedup Jani Nikula
2013-03-31  9:45 ` [PATCH v3 1/6] cli: remove useless talloc_strdup Jani Nikula
2013-03-31  9:45 ` [PATCH v3 2/6] cli: extract count printing to a separate function in notmuch count Jani Nikula
2013-03-31  9:46 ` [PATCH v3 3/6] cli: add --batch option to " Jani Nikula
2013-03-31  9:46 ` [PATCH v3 4/6] man: document notmuch count --batch and --input options Jani Nikula
2013-03-31  9:46 ` Jani Nikula [this message]
2013-03-31  9:46 ` [PATCH v3 6/6] emacs: hello: use batch count Jani Nikula
2013-03-31 16:38 ` [PATCH v3 0/6] batch count for notmuch-hello speedup Tomi Ollila
2013-04-01 13:43 ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b425e543ab3fabb51e9cc88fd6faee2c9433c636.1364722841.git.jani@nikula.org \
    --to=jani@nikula.org \
    --cc=notmuch@notmuchmail.org \
    --cc=tomi.ollila@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).