mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 10:58:10 +01:00
test: add regression test for n_d_get_directory
At least this exception is already handled correctly.
This commit is contained in:
parent
959cb4b7a7
commit
1ca805a962
1 changed files with 17 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue