]> git.notmuchmail.org Git - notmuch/blob - test/count
test: fix count test
[notmuch] / test / count
1 #!/usr/bin/env bash
2 test_description='"notmuch count" for messages and threads'
3 . ./test-lib.sh
4
5 add_email_corpus
6
7 test_begin_subtest "message count is the default for notmuch count"
8 test_expect_equal \
9     "`notmuch search --output=messages '*' | wc -l`" \
10     "`notmuch count '*'`"
11
12 test_begin_subtest "message count with --output=messages"
13 test_expect_equal \
14     "`notmuch search --output=messages '*' | wc -l`" \
15     "`notmuch count --output=messages '*'`"
16
17 test_begin_subtest "thread count with --output=threads"
18 test_expect_equal \
19     "`notmuch search --output=threads '*' | wc -l`" \
20     "`notmuch count --output=threads '*'`"
21
22 test_begin_subtest "thread count is the default for notmuch search"
23 test_expect_equal \
24     "`notmuch search '*' | wc -l`" \
25     "`notmuch count --output=threads '*'`"
26
27 test_begin_subtest "count with no matching messages"
28 test_expect_equal \
29     "0" \
30     "`notmuch count --output=messages from:cworth and not from:cworth`"
31
32 test_begin_subtest "count with no matching threads"
33 test_expect_equal \
34     "0" \
35     "`notmuch count --output=threads from:cworth and not from:cworth`"
36
37 test_done