2 test_description='"notmuch show"'
4 . $(dirname "$0")/test-lib.sh || exit 1
8 test_begin_subtest "exit code for show invalid query"
11 test_expect_equal 1 $exit_code
13 test_begin_subtest "notmuch show --sort=newest-first"
14 notmuch show --entire-thread=true '*' > EXPECTED
15 notmuch show --entire-thread=true --sort=newest-first '*' > OUTPUT
16 test_expect_equal_file EXPECTED OUTPUT
18 test_begin_subtest "notmuch show --sort=oldest-first"
19 notmuch show --entire-thread=true '*' | grep ^depth:0 > EXPECTED
20 notmuch show --entire-thread=true --sort=oldest-first '*' | grep ^depth:0 > OLDEST
21 perl -e 'print reverse<>' OLDEST > OUTPUT
22 test_expect_equal_file EXPECTED OUTPUT
24 test_begin_subtest "notmuch show --sort for single thread"
25 QUERY="id:yun1vjwegii.fsf@aiko.keithp.com"
26 notmuch show --entire-thread=true --sort=newest-first $QUERY > EXPECTED
27 notmuch show --entire-thread=true --sort=oldest-first $QUERY > OUTPUT
28 test_expect_equal_file EXPECTED OUTPUT