diff options
| author | David Bremner <david@tethera.net> | 2020-08-01 09:26:02 -0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2020-08-03 21:03:43 -0300 |
| commit | e3f88436b7850ac04468416223e136eaaca4aee3 (patch) | |
| tree | 90f209bdbf4a671a401e1e2f534b34740c61333d /test | |
| parent | a0b2a54aa7514c3360c791fc186848df49a8c5fd (diff) | |
test: regression test for traversing config list with closed db
Also mention error return in API docs
Diffstat (limited to 'test')
| -rwxr-xr-x | test/T590-libconfig.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/T590-libconfig.sh b/test/T590-libconfig.sh index 602fad0b..360e45b0 100755 --- a/test/T590-libconfig.sh +++ b/test/T590-libconfig.sh @@ -100,6 +100,28 @@ zzzafter afterval EOF test_expect_equal_file EXPECTED OUTPUT +test_begin_subtest "notmuch_database_get_config_list: all pairs (closed db)" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} +{ + notmuch_config_list_t *list; + EXPECT0(notmuch_database_get_config_list (db, "", &list)); + EXPECT0(notmuch_database_close (db)); + for (; notmuch_config_list_valid (list); notmuch_config_list_move_to_next (list)) { + printf("%s %d\n", notmuch_config_list_key (list), NULL == notmuch_config_list_value(list)); + } + notmuch_config_list_destroy (list); +} +EOF +cat <<'EOF' >EXPECTED +== stdout == +aaabefore 1 +testkey1 1 +testkey2 1 +zzzafter 1 +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + test_begin_subtest "notmuch_database_get_config_list: one prefix" cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} { |
