aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2020-07-19 07:57:39 -0300
committerDavid Bremner <david@tethera.net>2020-07-22 19:52:55 -0300
commitdfab190a4089b3d04addd0989053461d43c2bdeb (patch)
tree4ded19eda35e25eb117f2719cf213287c1ea5612 /test
parent64aa8961512b47166954d196fd2ca04b2b22cd42 (diff)
lib: add regresion test for n_d_get_all_tags
Existing error handling seems adequate, if not ideal.
Diffstat (limited to 'test')
-rwxr-xr-xtest/T562-lib-database.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/T562-lib-database.sh b/test/T562-lib-database.sh
index 745e91b3..60e944fc 100755
--- a/test/T562-lib-database.sh
+++ b/test/T562-lib-database.sh
@@ -321,4 +321,22 @@ A Xapian exception occurred finding/creating a directory: Database has been clos
EOF
test_expect_equal_file EXPECTED OUTPUT
+test_begin_subtest "Handle getting tags from closed database"
+cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
+ {
+ notmuch_tags_t *result;
+ EXPECT0(notmuch_database_close (db));
+ result = notmuch_database_get_all_tags (db);
+ printf("%d\n", result == NULL);
+ stat = NOTMUCH_STATUS_XAPIAN_EXCEPTION;
+ }
+EOF
+cat <<EOF > EXPECTED
+== stdout ==
+1
+== stderr ==
+A Xapian exception occurred getting tags: Database has been closed.
+EOF
+test_expect_equal_file EXPECTED OUTPUT
+
test_done