aboutsummaryrefslogtreecommitdiff
path: root/test/T520-show.sh
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-07-02 21:44:21 +0100
committerDavid Bremner <david@tethera.net>2021-07-03 20:27:39 -0300
commit13d49b8e16cfbe9ea473754a3f59861cd68549e1 (patch)
tree9c02526cb279d79e4f2a7547e583f2a4c7106cec /test/T520-show.sh
parent8316fc3ca14b311b5147738d1a4244e613454d06 (diff)
CLI/show: tests for the new --sort option
New unit tests for notmuch show --sort, covering the basic use cases.
Diffstat (limited to 'test/T520-show.sh')
-rwxr-xr-xtest/T520-show.sh17
1 files changed, 17 insertions, 0 deletions
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