]> git.notmuchmail.org Git - notmuch/commitdiff
test: add regression tests for n_t_get_{authors, subject}
authorDavid Bremner <david@tethera.net>
Fri, 24 Jul 2020 11:14:03 +0000 (08:14 -0300)
committerDavid Bremner <david@tethera.net>
Fri, 31 Jul 2020 10:41:00 +0000 (07:41 -0300)
This is returning explicitely cached data, so no database access is needed.

test/T568-lib-thread.sh

index c7d4f26bb84f705d8829b59f8c3906131fe9d530..0f9fa4439235123f54f1548bf722bfe275c28c65 100755 (executable)
@@ -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