aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2020-07-08 21:17:00 -0300
committerDavid Bremner <david@tethera.net>2020-07-20 08:45:15 -0300
commitb21f0fcb6abc4cf399c708c45e2e33a39a820a9e (patch)
tree971ca2676415a172c00187d2b2804d4486bc2c82 /test
parent7aaf6cbe9ac20d99046d1bdf260fe0fa72519760 (diff)
test: add regression test for notmuch_message_has_maildir_flag
This passes the NULL return inside _ensure_maildir_flags does not break anything. Probably this should be handled more explicitely.
Diffstat (limited to 'test')
-rwxr-xr-xtest/T560-lib-error.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh
index 36c4c1ce..02478e92 100755
--- a/test/T560-lib-error.sh
+++ b/test/T560-lib-error.sh
@@ -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