diff options
| author | David Bremner <david@tethera.net> | 2020-08-01 09:25:51 -0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2020-08-03 20:47:18 -0300 |
| commit | e5e17926dbb0739ddd23b56599a8a580225f01a2 (patch) | |
| tree | 766fe0981061d45511764d61295fbb980de96110 | |
| parent | 31dab9b1cd66c7f285fe86021f66940f679325d4 (diff) | |
test: add regression test for n_messages_collect_tags
Also test n_messages_destroy.
| -rwxr-xr-x | test/T568-lib-thread.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/T568-lib-thread.sh b/test/T568-lib-thread.sh index 66066854..ac13d986 100755 --- a/test/T568-lib-thread.sh +++ b/test/T568-lib-thread.sh @@ -285,6 +285,37 @@ unread EOF test_expect_equal_file EXPECTED OUTPUT +test_begin_subtest "collect tags with closed database" +cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} + { + notmuch_messages_t *messages = notmuch_thread_get_messages (thread); + + notmuch_tags_t *tags = notmuch_messages_collect_tags (messages); + + const char *tag; + for (tags = notmuch_thread_get_tags (thread); + notmuch_tags_valid (tags); + notmuch_tags_move_to_next (tags)) + { + tag = notmuch_tags_get (tags); + printf ("%s\n", tag); + } + notmuch_tags_destroy (tags); + notmuch_messages_destroy (messages); + + printf("SUCCESS\n"); + } +EOF +cat <<EOF > EXPECTED +== stdout == +inbox +signed +unread +SUCCESS +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + test_begin_subtest "destroy thread with closed database" cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} { |
