Merge branch 'jk/test-lazy-prereq-heredoc' into jch

The lazy prerequisite set-up script can be fed as a here-doc, just
like test_expect_{success,failure} scripts these days.

* jk/test-lazy-prereq-heredoc:
  test-lib: allow lazy prerequisite snippets as here-docs
jch
Junio C Hamano 2026-10-12 09:25:59 -07:00
commit 165dbeec57
2 changed files with 5 additions and 5 deletions

View File

@ -21,14 +21,14 @@ start_httpd
# authentication after an early HTTP/2 response. This bug was introduced
# in cURL v7.88.0 (8c762f5998 (http2: minor buffer and error path fixes,
# 2023-02-08)) and fixed in v8.3.0 (https://github.com/curl/curl/pull/11756).
test_lazy_prereq HAVE_CURL_HTTP2_BUG '
test_lazy_prereq HAVE_CURL_HTTP2_BUG - <<\EOT
test_have_prereq HTTP2 &&
build_option libcurl |
awk -F. '\''
awk -F. '
($1 == 7 && $2 >= 88) || ($1 == 8 && $2 < 3) { broken = 1 }
END { exit !broken }
'\''
'
'
EOT

test_expect_success HTTP2 'enable client-side http/2' '
git config --global http.version HTTP/2

View File

@ -760,7 +760,7 @@ lazily_testable_prereq= lazily_tested_prereq=
# Usage: test_lazy_prereq PREREQ 'script'
test_lazy_prereq () {
lazily_testable_prereq="$lazily_testable_prereq$1 "
eval test_prereq_lazily_$1=\$2
test_body_or_stdin "test_prereq_lazily_$1" "$2"
}

test_run_lazy_prereq_ () {