aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2020-07-24 08:14:00 -0300
committerDavid Bremner <david@tethera.net>2020-07-31 07:41:00 -0300
commit02ab473115f064c8f53fc46cc06a33e40588906d (patch)
tree438d3b6f0577fbeaa8d5208dd772f607b2b26094
parent0baa581e6ee71ab76ced001ebebd7b96d8180ec2 (diff)
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.
-rwxr-xr-xtest/T568-lib-thread.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/T568-lib-thread.sh b/test/T568-lib-thread.sh
index 00755834..5816cfbc 100755
--- a/test/T568-lib-thread.sh
+++ b/test/T568-lib-thread.sh
@@ -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