unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jani Nikula <jani@nikula.org>
To: notmuch@notmuchmail.org
Subject: [PATCH v2 2/2] test: add tests for --output=messages --duplicate=N
Date: Sat,  1 Nov 2014 11:31:07 +0200	[thread overview]
Message-ID: <eea379e10ceda78c1864316c6a2529967a7dfb14.1414834143.git.jani@nikula.org> (raw)
In-Reply-To: <cover.1414834143.git.jani@nikula.org>
In-Reply-To: <cover.1414834143.git.jani@nikula.org>

Basic smoke tests for the feature, nothing fancy.
---
 test/T090-search-output.sh | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/test/T090-search-output.sh b/test/T090-search-output.sh
index 947d572ebeff..fe2ec9af8c2a 100755
--- a/test/T090-search-output.sh
+++ b/test/T090-search-output.sh
@@ -122,6 +122,24 @@ id:1258471718-6781-1-git-send-email-dottedmag@dottedmag.net
 EOF
 test_expect_equal_file OUTPUT EXPECTED
 
+test_begin_subtest "--output=messages --duplicate=1"
+notmuch search --output=messages --duplicate=1 '*' >OUTPUT
+# reuse same EXPECTED as above
+test_expect_equal_file OUTPUT EXPECTED
+
+test_begin_subtest "--output=messages --duplicate=2"
+notmuch search --output=messages --duplicate=2 '*' >OUTPUT
+cat <<EOF >EXPECTED
+id:20091117232137.GA7669@griffis1.net
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
+test_begin_subtest "--output=messages --duplicate=3"
+notmuch search --output=messages --duplicate=3 '*' >OUTPUT
+cat <<EOF >EXPECTED
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
 test_begin_subtest "--output=messages --format=json"
 notmuch search --format=json --output=messages '*' >OUTPUT
 cat <<EOF >EXPECTED
@@ -180,6 +198,25 @@ cat <<EOF >EXPECTED
 EOF
 test_expect_equal_file OUTPUT EXPECTED
 
+test_begin_subtest "--output=messages --format=json --duplicate=1"
+notmuch search --output=messages --format=json --duplicate=1 '*' >OUTPUT
+# reuse same EXPECTED as above
+test_expect_equal_file OUTPUT EXPECTED
+
+test_begin_subtest "--output=messages --format=json --duplicate=2"
+notmuch search --output=messages --format=json --duplicate=2 '*' >OUTPUT
+cat <<EOF >EXPECTED
+["20091117232137.GA7669@griffis1.net"]
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
+test_begin_subtest "--output=messages --format=json --duplicate=3"
+notmuch search --output=messages --format=json --duplicate=3 '*' >OUTPUT
+cat <<EOF >EXPECTED
+[]
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
 test_begin_subtest "--output=files"
 notmuch search --output=files '*' | notmuch_search_files_sanitize | sort >OUTPUT
 cat <<EOF >EXPECTED
-- 
2.1.1

  parent reply	other threads:[~2014-11-01  9:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-01  9:31 [PATCH v2 0/2] cli: search --duplicate=N with --output=messages Jani Nikula
2014-11-01  9:31 ` [PATCH v2 1/2] cli: add support for notmuch " Jani Nikula
2014-11-02 19:03   ` David Bremner
2014-11-01  9:31 ` Jani Nikula [this message]
2014-11-01 10:06 ` [PATCH v2 0/2] cli: " Tomi Ollila

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=eea379e10ceda78c1864316c6a2529967a7dfb14.1414834143.git.jani@nikula.org \
    --to=jani@nikula.org \
    --cc=notmuch@notmuchmail.org \
    /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).