mirror of
https://git.notmuchmail.org/git/notmuch
synced 2025-01-03 15:21:41 +01:00
test: add regression test for n_thread_get_total_{messages,files}
This is returning cached info, so does not need to access the (closed) database.
This commit is contained in:
parent
0baa581e6e
commit
02ab473115
1 changed files with 32 additions and 0 deletions
|
@ -60,4 +60,36 @@ cat <<EOF > EXPECTED
|
|||
EOF
|
||||
test_expect_equal_file EXPECTED OUTPUT
|
||||
|
||||
test_begin_subtest "get total messages with closed database"
|
||||
cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
|
||||
{
|
||||
int count;
|
||||
count = notmuch_thread_get_total_messages (thread);
|
||||
printf("%d\n%d\n", thread != NULL, count);
|
||||
}
|
||||
EOF
|
||||
cat <<EOF > EXPECTED
|
||||
== stdout ==
|
||||
1
|
||||
7
|
||||
== stderr ==
|
||||
EOF
|
||||
test_expect_equal_file EXPECTED OUTPUT
|
||||
|
||||
test_begin_subtest "get total files with closed database"
|
||||
cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
|
||||
{
|
||||
int count;
|
||||
count = notmuch_thread_get_total_files (thread);
|
||||
printf("%d\n%d\n", thread != NULL, count);
|
||||
}
|
||||
EOF
|
||||
cat <<EOF > EXPECTED
|
||||
== stdout ==
|
||||
1
|
||||
7
|
||||
== stderr ==
|
||||
EOF
|
||||
test_expect_equal_file EXPECTED OUTPUT
|
||||
|
||||
test_done
|
||||
|
|
Loading…
Reference in a new issue