mirror of
https://git.notmuchmail.org/git/notmuch
synced 2025-01-03 15:21:41 +01:00
test: regression test for n_thread_get_tags
Code is taken from the API docs, with the twist that the underlying database is closed. Not crashing is the main point.
This commit is contained in:
parent
43406e7d4c
commit
864f422f14
1 changed files with 23 additions and 0 deletions
|
@ -262,5 +262,28 @@ cat <<EOF > EXPECTED
|
||||||
EOF
|
EOF
|
||||||
test_expect_equal_file EXPECTED OUTPUT
|
test_expect_equal_file EXPECTED OUTPUT
|
||||||
|
|
||||||
|
test_begin_subtest "iterate tags from closed database"
|
||||||
|
cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
|
||||||
|
{
|
||||||
|
notmuch_tags_t *tags;
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
cat <<EOF > EXPECTED
|
||||||
|
== stdout ==
|
||||||
|
inbox
|
||||||
|
signed
|
||||||
|
unread
|
||||||
|
== stderr ==
|
||||||
|
EOF
|
||||||
|
test_expect_equal_file EXPECTED OUTPUT
|
||||||
|
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
|
Loading…
Reference in a new issue