git/t/chainlint
Jeff King 0c7d630220 chainlint.pl: add tests for test body in heredoc
The chainlint.pl script recently learned about the upcoming:

  test_expect_success 'some test' - <<\EOT
	TEST_BODY
  EOT

syntax, where TEST_BODY should be checked in the usual way. Let's make
sure this works by adding a few tests. The "here-doc-body" file tests
the basic syntax, including an embedded here-doc which we should still
be able to recognize.

Likewise the "here-doc-body-indent" checks the same thing, but using the
"<<-" operator. We wouldn't expect this to be used normally, but we
would not want to accidentally miss a body that uses it. The
"pathological" variant checks the opposite: we don't get confused by an
indented tag within the here-doc body.

The "here-doc-double" tests the handling of two here-doc tags on the
same line. This is not something we'd expect anybody to do in practice,
but the code was written defensively to handle this, so let's make sure
it works.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-07-10 10:14:22 -07:00
..
arithmetic-expansion.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
arithmetic-expansion.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
bash-array.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
bash-array.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
blank-line-before-esac.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
blank-line-before-esac.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
blank-line.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
blank-line.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
block-comment.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
block-comment.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
block.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
block.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
broken-chain.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
broken-chain.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
case-comment.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
case-comment.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
case.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
case.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
chain-break-background.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
chain-break-background.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
chain-break-continue.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
chain-break-continue.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
chain-break-false.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
chain-break-false.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
chain-break-return-exit.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
chain-break-return-exit.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
chain-break-status.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
chain-break-status.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
chained-block.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
chained-block.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
chained-subshell.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
chained-subshell.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
close-nested-and-parent-together.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
close-nested-and-parent-together.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
close-subshell.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
close-subshell.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
command-substitution-subsubshell.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
command-substitution-subsubshell.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
command-substitution.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
command-substitution.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
comment.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
comment.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
complex-if-in-cuddled-loop.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
complex-if-in-cuddled-loop.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
cuddled-if-then-else.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
cuddled-if-then-else.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
cuddled-loop.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
cuddled-loop.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
cuddled.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
cuddled.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
double-here-doc.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
double-here-doc.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
dqstring-line-splice.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
dqstring-line-splice.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
dqstring-no-interpolate.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
dqstring-no-interpolate.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
empty-here-doc.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
empty-here-doc.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
exclamation.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
exclamation.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
exit-loop.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
exit-loop.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
exit-subshell.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
exit-subshell.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
for-loop-abbreviated.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
for-loop-abbreviated.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
for-loop.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
for-loop.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
function.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
function.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
here-doc-body-indent.expect chainlint.pl: add tests for test body in heredoc 2024-07-10 10:14:22 -07:00
here-doc-body-indent.test chainlint.pl: add tests for test body in heredoc 2024-07-10 10:14:22 -07:00
here-doc-body-pathological.expect chainlint.pl: add tests for test body in heredoc 2024-07-10 10:14:22 -07:00
here-doc-body-pathological.test chainlint.pl: add tests for test body in heredoc 2024-07-10 10:14:22 -07:00
here-doc-body.expect chainlint.pl: add tests for test body in heredoc 2024-07-10 10:14:22 -07:00
here-doc-body.test chainlint.pl: add tests for test body in heredoc 2024-07-10 10:14:22 -07:00
here-doc-close-subshell.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
here-doc-close-subshell.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
here-doc-double.expect chainlint.pl: add tests for test body in heredoc 2024-07-10 10:14:22 -07:00
here-doc-double.test chainlint.pl: add tests for test body in heredoc 2024-07-10 10:14:22 -07:00
here-doc-indent-operator.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
here-doc-indent-operator.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
here-doc-multi-line-command-subst.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
here-doc-multi-line-command-subst.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
here-doc-multi-line-string.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
here-doc-multi-line-string.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
here-doc.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
here-doc.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
if-condition-split.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
if-condition-split.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
if-in-loop.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
if-in-loop.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
if-then-else.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
if-then-else.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
incomplete-line.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
incomplete-line.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
inline-comment.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
inline-comment.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
loop-detect-failure.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
loop-detect-failure.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
loop-detect-status.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
loop-detect-status.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
loop-in-if.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
loop-in-if.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
loop-upstream-pipe.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
loop-upstream-pipe.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
multi-line-nested-command-substitution.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
multi-line-nested-command-substitution.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
multi-line-string.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
multi-line-string.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
negated-one-liner.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
negated-one-liner.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
nested-cuddled-subshell.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
nested-cuddled-subshell.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
nested-here-doc.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
nested-here-doc.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
nested-loop-detect-failure.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
nested-loop-detect-failure.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
nested-subshell-comment.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
nested-subshell-comment.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
nested-subshell.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
nested-subshell.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
not-heredoc.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
not-heredoc.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
one-liner-for-loop.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
one-liner-for-loop.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
one-liner.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
one-liner.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
p4-filespec.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
p4-filespec.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
pipe.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
pipe.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
return-loop.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
return-loop.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
semicolon.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
semicolon.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
sqstring-in-sqstring.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
sqstring-in-sqstring.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
subshell-here-doc.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
subshell-here-doc.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
subshell-one-liner.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
subshell-one-liner.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
t7900-subtree.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
t7900-subtree.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
token-pasting.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
token-pasting.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
unclosed-here-doc-indent.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
unclosed-here-doc-indent.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
unclosed-here-doc.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
unclosed-here-doc.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
while-loop.expect chainlint.pl: check line numbers in expected output 2024-07-10 10:14:22 -07:00
while-loop.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00