diff --git a/t/chainlint/here-doc-body-indent.expect b/t/chainlint/here-doc-body-indent.expect new file mode 100644 index 0000000000..4323acc93d --- /dev/null +++ b/t/chainlint/here-doc-body-indent.expect @@ -0,0 +1,2 @@ +2 echo "we should find this" ?!AMP?! +3 echo "even though our heredoc has its indent stripped" diff --git a/t/chainlint/here-doc-body-indent.test b/t/chainlint/here-doc-body-indent.test new file mode 100644 index 0000000000..39ff970ef3 --- /dev/null +++ b/t/chainlint/here-doc-body-indent.test @@ -0,0 +1,4 @@ +test_expect_success 'here-doc-body-indent' - <<-\EOT + echo "we should find this" + echo "even though our heredoc has its indent stripped" +EOT diff --git a/t/chainlint/here-doc-body-pathological.expect b/t/chainlint/here-doc-body-pathological.expect new file mode 100644 index 0000000000..a93a1fa3aa --- /dev/null +++ b/t/chainlint/here-doc-body-pathological.expect @@ -0,0 +1,7 @@ +2 echo "outer here-doc does not allow indented end-tag" ?!AMP?! +3 cat >file <<-\EOF && +4 but this inner here-doc +5 does allow indented EOF +6 EOF +7 echo "missing chain after" ?!AMP?! +8 echo "but this line is OK because it's the end" diff --git a/t/chainlint/here-doc-body-pathological.test b/t/chainlint/here-doc-body-pathological.test new file mode 100644 index 0000000000..7d2daa44f9 --- /dev/null +++ b/t/chainlint/here-doc-body-pathological.test @@ -0,0 +1,9 @@ +test_expect_success 'here-doc-body-pathological' - <<\EOF + echo "outer here-doc does not allow indented end-tag" + cat >file <<-\EOF && + but this inner here-doc + does allow indented EOF + EOF + echo "missing chain after" + echo "but this line is OK because it's the end" +EOF diff --git a/t/chainlint/here-doc-body.expect b/t/chainlint/here-doc-body.expect new file mode 100644 index 0000000000..ddf1c412af --- /dev/null +++ b/t/chainlint/here-doc-body.expect @@ -0,0 +1,7 @@ +2 echo "missing chain before" ?!AMP?! +3 cat >file <<-\EOF && +4 inside inner here-doc +5 these are not shell commands +6 EOF +7 echo "missing chain after" ?!AMP?! +8 echo "but this line is OK because it's the end" diff --git a/t/chainlint/here-doc-body.test b/t/chainlint/here-doc-body.test new file mode 100644 index 0000000000..989ac2f4e1 --- /dev/null +++ b/t/chainlint/here-doc-body.test @@ -0,0 +1,9 @@ +test_expect_success 'here-doc-body' - <<\EOT + echo "missing chain before" + cat >file <<-\EOF && + inside inner here-doc + these are not shell commands + EOF + echo "missing chain after" + echo "but this line is OK because it's the end" +EOT diff --git a/t/chainlint/here-doc-double.expect b/t/chainlint/here-doc-double.expect new file mode 100644 index 0000000000..20dba4b452 --- /dev/null +++ b/t/chainlint/here-doc-double.expect @@ -0,0 +1,2 @@ +8 echo "actual test commands" ?!AMP?! +9 echo "that should be checked" diff --git a/t/chainlint/here-doc-double.test b/t/chainlint/here-doc-double.test new file mode 100644 index 0000000000..777389f0d9 --- /dev/null +++ b/t/chainlint/here-doc-double.test @@ -0,0 +1,10 @@ +# This is obviously a ridiculous thing to do, but we should be able +# to handle two here-docs on the same line, and attribute them +# correctly. +test_expect_success "$(cat <