diff options
| author | David Bremner <david@tethera.net> | 2020-07-17 07:38:09 -0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2020-07-22 19:52:55 -0300 |
| commit | 1ca805a9620c7e09cb6c4022e6ffe9b95a3fc04f (patch) | |
| tree | 89770809b84b719058bbb2ef924b3066cede2a34 | |
| parent | 959cb4b7a7d2a723a297468c7a0a2c12e9ec95bd (diff) | |
test: add regression test for n_d_get_directory
At least this exception is already handled correctly.
| -rwxr-xr-x | test/T562-lib-database.sh | 17 |
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 |
