unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: jao <jao@gnu.org>
To: notmuch@notmuchmail.org
Cc: jao <jao@gnu.org>
Subject: [PATCH 2/5] CLI/show: tests for the new --sort option
Date: Sat, 26 Jun 2021 19:06:47 +0100	[thread overview]
Message-ID: <20210626180650.342569-3-jao@gnu.org> (raw)
In-Reply-To: <20210626180650.342569-1-jao@gnu.org>

New unit tests for notmuch show --sort, covering the basic use cases.
---
 test/T520-show.sh | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/test/T520-show.sh b/test/T520-show.sh
index 16222650..6f42ca12 100755
--- a/test/T520-show.sh
+++ b/test/T520-show.sh
@@ -10,4 +10,21 @@ notmuch show foo..
 exit_code=$?
 test_expect_equal 1 $exit_code
 
+test_begin_subtest "notmuch show --sort=newest-first"
+notmuch show --entire-thread=true '*' > EXPECTED
+notmuch show --entire-thread=true --sort=newest-first '*' > OUTPUT
+test_expect_equal_file EXPECTED OUTPUT
+
+test_begin_subtest "notmuch show --sort=oldest-first"
+notmuch show --entire-thread=true '*' | grep ^depth:0 > EXPECTED
+notmuch show --entire-thread=true --sort=oldest-first '*' | grep ^depth:0 > OLDEST
+perl -e 'print reverse<>' OLDEST > OUTPUT
+test_expect_equal_file EXPECTED OUTPUT
+
+test_begin_subtest "notmuch show --sort for single thread"
+QUERY="id:yun1vjwegii.fsf@aiko.keithp.com"
+notmuch show --entire-thread=true --sort=newest-first $QUERY > EXPECTED
+notmuch show --entire-thread=true --sort=oldest-first $QUERY > OUTPUT
+test_expect_equal_file EXPECTED OUTPUT
+
 test_done
-- 
2.32.0

  parent reply	other threads:[~2021-06-26 18:07 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-26  2:28 New --sort for notmuch show and using it in emacs notmuch-tree-mode jao
2021-06-26  2:28 ` [PATCH 1/7] CLI/show: accept --sort jao
2021-06-26  2:28 ` [PATCH 2/7] emacs/hello: honouring :sort-order in threaded queries jao
2021-06-26  2:28 ` [PATCH 3/7] emacs/tree: command to toggle search sort order in tree mode jao
2021-06-26 10:31   ` David Bremner
2021-06-26 15:38     ` Jose Antonio Ortega Ruiz
2021-06-26  2:28 ` [PATCH 4/7] doc: updates for new --sort and related emacs commands jao
2021-06-26 10:36   ` David Bremner
2021-06-26  2:28 ` [PATCH 5/7] CLI/show: tests for the new --sort option jao
2021-06-26  2:28 ` [PATCH 6/7] doc: clarifications for the new --sort flag and emacs command jao
2021-06-26  2:28 ` [PATCH 7/7] emacs: fix notmuch-tree-toggle-order keybinding jao
2021-06-26 10:41   ` David Bremner
2021-06-26 10:46     ` David Bremner
2021-06-26 15:41       ` Jose Antonio Ortega Ruiz
2021-06-26 16:55         ` Jose Antonio Ortega Ruiz
2021-06-26 17:42           ` David Bremner
2021-06-26 18:08             ` Jose Antonio Ortega Ruiz
2021-06-26 18:02 ` [PATCH 1/5] CLI/show: accept --sort jao
2021-06-26 18:06 ` Here's a re-roll, with review comments so far addressed jao
2021-06-26 18:06   ` [PATCH 1/5] CLI/show: accept --sort jao
2021-06-26 18:06   ` jao [this message]
2021-06-26 18:06   ` [PATCH 3/5] emacs/hello: honouring :sort-order in threaded queries jao
2021-06-26 18:06   ` [PATCH 4/5] emacs/tree: command to toggle search sort order in tree mode jao
2021-06-26 18:06   ` [PATCH 5/5] doc: new notmuch show --sort and related emacs commands jao

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=20210626180650.342569-3-jao@gnu.org \
    --to=jao@gnu.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).