]> git.notmuchmail.org Git - notmuch/blobdiff - test/T560-lib-error.sh
test: add regression test for notmuch_message_has_maildir_flag
[notmuch] / test / T560-lib-error.sh
index 36c4c1cec9c81368d945f09af35b854a2e8a2ba1..02478e92113045ec5407d91972eeb08b79160203 100755 (executable)
@@ -533,4 +533,20 @@ cat <<EOF > EXPECTED
 EOF
 test_expect_equal_file EXPECTED OUTPUT
 
+test_begin_subtest "Handle read maildir flag with closed database"
+cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR}
+    {
+        notmuch_bool_t is_set = -1;
+        is_set = notmuch_message_has_maildir_flag (message, 'S');
+        printf("%d\n%d\n", message != NULL, is_set == FALSE || is_set == TRUE);
+    }
+EOF
+cat <<EOF > EXPECTED
+== stdout ==
+1
+1
+== stderr ==
+EOF
+test_expect_equal_file EXPECTED OUTPUT
+
 test_done