aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2020-07-08 21:17:07 -0300
committerDavid Bremner <david@tethera.net>2020-07-20 08:54:42 -0300
commita2279c322e65ff26a136a2fb801a1d0670a45c69 (patch)
treef2e43605fb9341b36b87f97dad88f601c51e26c9
parent1578e2af6a412a72346d5264d2d6707972a95b33 (diff)
test: regression for retrieving closed db from message
This is actually one of the few potentially useful things you can do with a message belonging to a closed database, since in principle you could re-open the database.
-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 492c1fb5..4805368a 100755
--- a/test/T560-lib-error.sh
+++ b/test/T560-lib-error.sh
@@ -645,4 +645,20 @@ cat <<EOF > EXPECTED
EOF
test_expect_equal_file EXPECTED OUTPUT
+test_begin_subtest "Handle retrieving closed db from message"
+cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR}
+ {
+ notmuch_database_t *db2;
+ db2 = notmuch_message_get_database (message);
+ printf("%d\n%d\n", message != NULL, db == db2);
+ }
+EOF
+cat <<EOF > EXPECTED
+== stdout ==
+1
+1
+== stderr ==
+EOF
+test_expect_equal_file EXPECTED OUTPUT
+
test_done