git/t/chainlint
Jeff King a5e450144d chainlint.pl: add test_expect_success call to test snippets
The chainlint tests are a series of individual files, each holding a
test body. The "make check-chainlint" target assembles them into a
single file, adding a "test_expect_success" function call around each.
Let's instead include that function call in the files themselves. This
is a little more boilerplate, but has several advantages:

  1. You can now run chainlint manually on snippets with just "perl
     chainlint.perl chainlint/foo.test". This can make developing and
     debugging a little easier.

  2. Many of the tests implicitly relied on the syntax of the lines
     added by the Makefile (in particular the use of single-quotes).
     This assumption is much easier to see when the single-quotes are
     alongside the test body.

  3. We had no way to test how the chainlint program handled
     various test_expect_success lines themselves. Now we'll be able to
     check variations.

The change to the .test files was done mechanically, using the same
test names they would have been assigned by the Makefile (this is
important to match the expected output). The Makefile has the minimal
change to drop the extra lines; there are more cleanups possible but a
future patch in this series will rewrite this substantially anyway.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-07-10 10:14:21 -07:00
..
arithmetic-expansion.expect
arithmetic-expansion.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
bash-array.expect
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 tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08: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 tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08: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
block-comment.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
block.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
block.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
broken-chain.expect
broken-chain.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
case-comment.expect
case-comment.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
case.expect
case.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
chain-break-background.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08: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
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
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 tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08: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 tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08: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
chained-block.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
chained-subshell.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08: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
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
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 tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08: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
command-substitution.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
comment.expect
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
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
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
cuddled-loop.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
cuddled.expect
cuddled.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
double-here-doc.expect
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 tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08: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 tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08: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 tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08: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 tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
exclamation.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
exit-loop.expect
exit-loop.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
exit-subshell.expect
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 tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08: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 tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
for-loop.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
function.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
function.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
here-doc-close-subshell.expect
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-indent-operator.expect
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
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
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 tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08: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
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
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
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
incomplete-line.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
inline-comment.expect
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
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 tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08: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
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
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
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
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
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 tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08: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
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 tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08: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
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 tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08: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
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
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
one-liner.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
p4-filespec.expect
p4-filespec.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
pipe.expect tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
pipe.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
return-loop.expect
return-loop.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
semicolon.expect
semicolon.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00
sqstring-in-sqstring.expect
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 tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08: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 tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08: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 tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08: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 tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08: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
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
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 tests: adjust whitespace in chainlint expectations 2023-12-15 08:36:14 -08:00
while-loop.test chainlint.pl: add test_expect_success call to test snippets 2024-07-10 10:14:21 -07:00