aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2020-07-24 08:14:03 -0300
committerDavid Bremner <david@tethera.net>2020-07-31 07:41:00 -0300
commitc5017c76d939610860a64906be77fe62a64eae96 (patch)
tree1f4486090a7b6377a89c41c43263d8ff922154c3 /test
parent70b30066f67ea75d405c8a246bf6ed923e2bdd59 (diff)
test: add regression tests for n_t_get_{authors, subject}
This is returning explicitely cached data, so no database access is needed.
Diffstat (limited to 'test')
-rwxr-xr-xtest/T568-lib-thread.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/T568-lib-thread.sh b/test/T568-lib-thread.sh
index c7d4f26b..0f9fa443 100755
--- a/test/T568-lib-thread.sh
+++ b/test/T568-lib-thread.sh
@@ -198,4 +198,37 @@ yunaayketfm.fsf@aiko.keithp.com
EOF
test_expect_equal_file EXPECTED OUTPUT
+test_begin_subtest "get authors from closed database"
+cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
+ {
+ const char *authors;
+ authors = notmuch_thread_get_authors (thread);
+ printf("%d\n%s\n", thread != NULL, authors);
+ }
+EOF
+cat <<EOF > EXPECTED
+== stdout ==
+1
+Lars Kellogg-Stedman, Mikhail Gusarov, Keith Packard, Carl Worth
+== stderr ==
+EOF
+test_expect_equal_file EXPECTED OUTPUT
+
+test_begin_subtest "get subject from closed database"
+cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
+ {
+ const char *subject;
+ subject = notmuch_thread_get_subject (thread);
+ printf("%d\n%s\n", thread != NULL, subject);
+ }
+EOF
+cat <<EOF > EXPECTED
+== stdout ==
+1
+[notmuch] Working with Maildir storage?
+== stderr ==
+EOF
+test_expect_equal_file EXPECTED OUTPUT
+
+
test_done