diff options
Diffstat (limited to 'tests/heredoc.tests')
-rw-r--r-- | tests/heredoc.tests | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/heredoc.tests b/tests/heredoc.tests new file mode 100644 index 00000000..aa694965 --- /dev/null +++ b/tests/heredoc.tests @@ -0,0 +1,45 @@ +# check order and content of multiple here docs + +cat << EOF1 << EOF2 +hi +EOF1 +there +EOF2 + +# check quoted here-doc is protected + +a=foo +cat << 'EOF' +hi\ +there$a +stuff +EOF + +# check that quoted here-documents don't have \newline processing done + +cat << 'EOF' +hi\ +there +EO\ +F +EOF +true + +# check that \newline is removed at start of here-doc +cat << EO\ +F +hi +EOF + +# check that \newline removal works for here-doc delimiter +cat << EOF +hi +EO\ +F + +# check that end of file delimits a here-document +# THIS MUST BE LAST! + +cat << EOF +hi +there |