[PATCH 5/7] CLI/show: tests for the new --sort option

Subject: [PATCH 5/7] CLI/show: tests for the new --sort option

Date: Sat, 26 Jun 2021 03:28:44 +0100

To: notmuch@notmuchmail.org

Cc: jao

From: jao


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
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: