diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh index 6432faaa..777eb375 100755 --- a/test/T560-lib-error.sh +++ b/test/T560-lib-error.sh @@ -371,4 +371,20 @@ cat < EXPECTED EOF test_expect_equal_file EXPECTED OUTPUT +test_begin_subtest "Handle getting header from closed database" +cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + const char *from; + from=notmuch_message_get_header (message, "from"); + printf("%s\n%d\n", id, from == NULL); + } +EOF +cat < EXPECTED +== stdout == +1258471718-6781-1-git-send-email-dottedmag@dottedmag.net +1 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + test_done