git/t/chainlint/here-doc-body-indent.test
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

4 lines
141 B
Text

test_expect_success 'here-doc-body-indent' - <<-\EOT
echo "we should find this"
echo "even though our heredoc has its indent stripped"
EOT