X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2FT520-show.sh;h=6f42ca12debaf795ab04f28aa80b97fc70ba6489;hb=717e3dcdc3e55d72c8e4a1948708c34170dbf926;hp=fb232a32510f77eced30311d02da2fc4a757d73e;hpb=02a2eeb427d6b424029f6e5e5ddad4c6ec987741;p=notmuch diff --git a/test/T520-show.sh b/test/T520-show.sh index fb232a32..6f42ca12 100755 --- a/test/T520-show.sh +++ b/test/T520-show.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash test_description='"notmuch show"' -. ./test-lib.sh || exit 1 +. $(dirname "$0")/test-lib.sh || exit 1 add_email_corpus @@ -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