diff options
| author | David Bremner <david@tethera.net> | 2021-05-12 08:42:28 -0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2021-05-12 08:42:28 -0300 |
| commit | 25da4a13407c0634d5b59fc2e1f3c2fe17db4438 (patch) | |
| tree | 989ce475cd33a7c1400fb0e034926f482c747631 /test | |
| parent | b4a4ed0df9cd2150e75853f5491cfa02fe72caf1 (diff) | |
| parent | 267365b711c3f81ffbe4bafd0fca6d6ede03685d (diff) | |
Merge branch 'release'
Diffstat (limited to 'test')
| -rwxr-xr-x | test/T400-hooks.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/T400-hooks.sh b/test/T400-hooks.sh index 00c99337..0c84b7dd 100755 --- a/test/T400-hooks.sh +++ b/test/T400-hooks.sh @@ -28,6 +28,16 @@ EOF echo "${TOKEN}" > ${2} } +create_change_hook () { + mkdir -p ${HOOK_DIR} + cat <<EOF >"${HOOK_DIR}/${1}" +#!/bin/sh +notmuch insert --no-hooks < ${2} > /dev/null +rm -f ${2} +EOF + chmod +x "${HOOK_DIR}/${1}" +} + create_failing_hook () { local HOOK_DIR=${2} mkdir -p ${HOOK_DIR} @@ -176,6 +186,20 @@ EOF NOTMUCH_NEW test_expect_equal_file write.expected write.output + test_begin_subtest "add message in pre-new [${config}]" + rm -rf ${HOOK_DIR} + generate_message '[subject]="add msg in pre-new"' + id1=$gen_msg_id + create_change_hook "pre-new" $gen_msg_filename $HOOK_DIR + generate_message '[subject]="add msg in new"' + NOTMUCH_NEW + notmuch search id:$id1 or id:$gen_msg_id | notmuch_search_sanitize > OUTPUT + cat <<EOF | sed s'/^[ \t]*//' > EXPECTED + thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; add msg in pre-new (inbox unread) + thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; add msg in new (inbox unread) +EOF + test_expect_equal_file EXPECTED OUTPUT + rm -rf ${HOOK_DIR} done test_done |
