diff options
| author | David Bremner <david@tethera.net> | 2020-07-22 07:51:20 -0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2020-07-29 12:19:39 -0300 |
| commit | 768efe88d0523f11e7c0e732e55a3c25e9cecbc8 (patch) | |
| tree | 67dfbd77f5b7506d0a71544cf855da09be0459f4 /test/T564-lib-query.sh | |
| parent | cbf9f890aab6a9fe6ce4fbe7f1a7903582ff5ff4 (diff) | |
test: regression test for notmuch_query_get_database
Current functionality is too trivial to really justify a test, but
it's simpler just to test the complete API.
Diffstat (limited to 'test/T564-lib-query.sh')
| -rwxr-xr-x | test/T564-lib-query.sh | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/test/T564-lib-query.sh b/test/T564-lib-query.sh index 103870a6..ac08344f 100755 --- a/test/T564-lib-query.sh +++ b/test/T564-lib-query.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -test_description="notmuch_database_* API" +test_description="notmuch_query_* API" . $(dirname "$0")/test-lib.sh || exit 1 @@ -58,4 +58,25 @@ id:1258471718-6781-1-git-send-email-dottedmag@dottedmag.net EOF test_expect_equal_file EXPECTED OUTPUT +test_begin_subtest "retrieve closed db from query" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + notmuch_query_t *query; + const char *str = "id:1258471718-6781-1-git-send-email-dottedmag@dottedmag.net"; + notmuch_database_t *db2; + + query = notmuch_query_create (db, str); + EXPECT0(notmuch_database_close (db)); + db2 = notmuch_query_get_database (query); + + printf("%d\n", db == db2); + } +EOF +cat <<EOF > EXPECTED +== stdout == +1 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + test_done |
