mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-23 01:44:52 +01:00
test: add regression tests for oldest and newest dates
These are strictly to watch for crashes, so don't be too fussy about the actual timestamps.
This commit is contained in:
parent
c5017c76d9
commit
43406e7d4c
1 changed files with 32 additions and 0 deletions
|
@ -230,5 +230,37 @@ cat <<EOF > EXPECTED
|
|||
EOF
|
||||
test_expect_equal_file EXPECTED OUTPUT
|
||||
|
||||
test_begin_subtest "oldest date from closed database"
|
||||
cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
|
||||
{
|
||||
time_t stamp;
|
||||
stamp = notmuch_thread_get_oldest_date (thread);
|
||||
printf("%d\n%d\n", thread != NULL, stamp > 0);
|
||||
}
|
||||
EOF
|
||||
cat <<EOF > EXPECTED
|
||||
== stdout ==
|
||||
1
|
||||
1
|
||||
== stderr ==
|
||||
EOF
|
||||
test_expect_equal_file EXPECTED OUTPUT
|
||||
|
||||
test_begin_subtest "newest date from closed database"
|
||||
cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
|
||||
{
|
||||
time_t stamp;
|
||||
stamp = notmuch_thread_get_newest_date (thread);
|
||||
printf("%d\n%d\n", thread != NULL, stamp > 0);
|
||||
}
|
||||
EOF
|
||||
cat <<EOF > EXPECTED
|
||||
== stdout ==
|
||||
1
|
||||
1
|
||||
== stderr ==
|
||||
EOF
|
||||
test_expect_equal_file EXPECTED OUTPUT
|
||||
|
||||
|
||||
test_done
|
||||
|
|
Loading…
Reference in a new issue