diff --git a/t/chainlint.sed b/t/chainlint.sed index 2f786f890d..0e575c0c62 100644 --- a/t/chainlint.sed +++ b/t/chainlint.sed @@ -62,20 +62,20 @@ # receives similar treatment. # # Swallowing here-docs with arbitrary tags requires a bit of finesse. When a -# line such as "cat <out" is seen, the here-doc tag is moved to the front -# of the line enclosed in angle brackets as a sentinel, giving "cat >out". +# line such as "cat <cat <\n\1$/ is attempted to see if # the content inside "<...>" matches the entirety of the newly-read line. For # instance, if the next line read is "some data", when concatenated with the -# target line, it becomes "cat >out\nsome data", and a match is attempted +# target line, it becomes "cat <cat >out\nEOF", +# encountered, it is appended to the target line giving "cat <" does match the text following the # newline, thus the closing here-doc tag has been found. The closing tag line # and the "<...>" prefix on the target line are then discarded, leaving just -# the target line "cat >out". +# the target line "cat <\1<\1\2/ :hered N /^<\([^>]*\)>.*\n[ ]*\1[ ]*$/!{ @@ -238,6 +237,7 @@ s/.*\n// :cont # retrieve and print previous line x +s/?!HERE?!/<\1<\1?!HERE?!\2\3/ :hdocsub N /^<\([^>]*\)>.*\n[ ]*\1[ ]*$/!{ @@ -293,6 +292,7 @@ bfolded # found "case ... in" -- pass through untouched :case x +s/?!HERE?!/<foo && +cat <<-Arbitrary_Tag_42 >foo && -cat >boo && +cat <boo && -horticulture +horticulture <foop && +cat <foop && ( - cat && - cat ?!AMP?! + cat <<-INPUT_END && + cat <<-EOT ?!AMP?! foobar ) diff --git a/t/chainlint/subshell-here-doc.expect b/t/chainlint/subshell-here-doc.expect index b7250ca753..029d129299 100644 --- a/t/chainlint/subshell-here-doc.expect +++ b/t/chainlint/subshell-here-doc.expect @@ -1,10 +1,10 @@ ( - echo wobba gorgo snoot wafta snurb && - cat >bip ?!AMP?! - echo >bop + echo wobba gorgo snoot wafta snurb <<-EOF && + cat <bip ?!AMP?! + echo <<-EOF >bop ) && ( - cat >bup && - cat >bup3 && + cat <<-ARBITRARY >bup && + cat <<-ARBITRARY3 >bup3 && meep ) diff --git a/t/chainlint/t7900-subtree.expect b/t/chainlint/t7900-subtree.expect index 215aca01c2..1cccc7bf7e 100644 --- a/t/chainlint/t7900-subtree.expect +++ b/t/chainlint/t7900-subtree.expect @@ -1,9 +1,9 @@ ( chks="sub1sub2sub3sub4" && - chks_sub=$(cat | sed "s,^,sub dir/," + chks_sub=$(cat <