aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2020-07-17 07:38:09 -0300
committerDavid Bremner <david@tethera.net>2020-07-22 19:52:55 -0300
commit1ca805a9620c7e09cb6c4022e6ffe9b95a3fc04f (patch)
tree89770809b84b719058bbb2ef924b3066cede2a34 /test
parent959cb4b7a7d2a723a297468c7a0a2c12e9ec95bd (diff)
test: add regression test for n_d_get_directory
At least this exception is already handled correctly.
Diffstat (limited to 'test')
-rwxr-xr-xtest/T562-lib-database.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/T562-lib-database.sh b/test/T562-lib-database.sh
index 620a9ca3..eed88f46 100755
--- a/test/T562-lib-database.sh
+++ b/test/T562-lib-database.sh
@@ -220,4 +220,21 @@ cat <<EOF > EXPECTED
EOF
test_expect_equal_file EXPECTED OUTPUT
+test_begin_subtest "get directory for a closed db"
+cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
+ {
+ notmuch_directory_t *dir;
+ EXPECT0(notmuch_database_close (db));
+ stat = notmuch_database_get_directory (db, "/nonexistent", &dir);
+ printf ("%d\n", stat == NOTMUCH_STATUS_XAPIAN_EXCEPTION);
+ }
+EOF
+cat <<EOF > EXPECTED
+== stdout ==
+1
+== stderr ==
+A Xapian exception occurred creating a directory: Database has been closed.
+EOF
+test_expect_equal_file EXPECTED OUTPUT
+
test_done