t/chainlint/*.test: don't use invalid shell syntax

The chainlint self-test code snippets are supposed to represent the body
of a test_expect_success() or test_expect_failure(), yet the contents of
these tests would have caused the shell to report syntax errors had they
been real test bodies. Although chainlint.sed, with its simplistic
heuristics, is blind to these syntactic problems, a future more robust
chainlint implementation might not have such a limitation, so make these
snippets syntactically valid.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Eric Sunshine
2021-12-13 01:30:45 -05:00
committed by Junio C Hamano
parent e773545c7f
commit 925d7304d2
3 changed files with 6 additions and 4 deletions

View File

@ -4,6 +4,7 @@
?!AMP?! echo very ?!AMP?! echo very
echo empty echo empty
elif test -z "" elif test -z ""
then
echo foo echo foo
else else
echo foo && echo foo &&
@ -14,6 +15,6 @@
( (
if test -n ""; then if test -n ""; then
echo very && echo very &&
?!AMP?! echo empty echo empty
if fi
>) >)

View File

@ -7,6 +7,7 @@
# LINT: last statement before 'elif' does not need "&&" # LINT: last statement before 'elif' does not need "&&"
echo empty echo empty
elif test -z "" elif test -z ""
then
# LINT: last statement before 'else' does not need "&&" # LINT: last statement before 'else' does not need "&&"
echo foo echo foo
else else
@ -24,5 +25,5 @@
if test -n ""; then if test -n ""; then
echo very && echo very &&
echo empty echo empty
if fi
) )