aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/build/script/parser+here-document.test.testscript
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/build/script/parser+here-document.test.testscript')
-rw-r--r--libbuild2/build/script/parser+here-document.test.testscript102
1 files changed, 81 insertions, 21 deletions
diff --git a/libbuild2/build/script/parser+here-document.test.testscript b/libbuild2/build/script/parser+here-document.test.testscript
index 8ea6373..f56a5e1 100644
--- a/libbuild2/build/script/parser+here-document.test.testscript
+++ b/libbuild2/build/script/parser+here-document.test.testscript
@@ -6,49 +6,85 @@
{
: missing-newline
:
+ $* <'cmd <<=' 2>>EOE != 0
+ buildfile:11:8: error: expected here-document end marker
+ EOE
+
+ : missing-newline-alias
+ :
$* <'cmd <<' 2>>EOE != 0
buildfile:11:7: error: expected here-document end marker
EOE
: missing-exit
:
+ $* <'cmd <<= != 0' 2>>EOE != 0
+ buildfile:11:9: error: expected here-document end marker
+ EOE
+
+ : missing-exit-alias
+ :
$* <'cmd << != 0' 2>>EOE != 0
buildfile:11:8: error: expected here-document end marker
EOE
: missing-empty
:
+ $* <'cmd <<=""' 2>>EOE != 0
+ buildfile:11:8: error: expected here-document end marker
+ EOE
+
+ : missing-empty-alias
+ :
$* <'cmd <<""' 2>>EOE != 0
buildfile:11:7: error: expected here-document end marker
EOE
: unseparated-expansion
:
+ $* <'cmd <<=FOO$foo' 2>>EOE != 0
+ buildfile:11:11: error: here-document end marker must be literal
+ EOE
+
+ : unseparated-expansion-alias
+ :
$* <'cmd <<FOO$foo' 2>>EOE != 0
buildfile:11:10: error: here-document end marker must be literal
EOE
: quoted-single-partial
:
- $* <"cmd <<F'O'O" 2>>EOE != 0
- buildfile:11:7: error: partially-quoted here-document end marker
+ $* <"cmd <<=F'O'O" 2>>EOE != 0
+ buildfile:11:8: error: partially-quoted here-document end marker
EOE
: quoted-double-partial
:
- $* <'cmd <<"FO"O' 2>>EOE != 0
- buildfile:11:7: error: partially-quoted here-document end marker
+ $* <'cmd <<="FO"O' 2>>EOE != 0
+ buildfile:11:8: error: partially-quoted here-document end marker
EOE
: quoted-mixed
:
- $* <"cmd <<\"FO\"'O'" 2>>EOE != 0
- buildfile:11:7: error: partially-quoted here-document end marker
+ $* <"cmd <<=\"FO\"'O'" 2>>EOE != 0
+ buildfile:11:8: error: partially-quoted here-document end marker
EOE
: unseparated
:
$* <<EOI >>EOO
+ cmd <<=EOF!=0
+ foo
+ EOF
+ EOI
+ cmd <<=EOF != 0
+ foo
+ EOF
+ EOO
+
+ : unseparated-alias
+ :
+ $* <<EOI >>EOO
cmd <<EOF!=0
foo
EOF
@@ -61,6 +97,18 @@
: quoted-single
:
$* <<EOI >>EOO
+ cmd <<='EOF'
+ foo
+ EOF
+ EOI
+ cmd <<=EOF
+ foo
+ EOF
+ EOO
+
+ : quoted-single-alias
+ :
+ $* <<EOI >>EOO
cmd <<'EOF'
foo
EOF
@@ -73,6 +121,18 @@
: quoted-double
:
$* <<EOI >>EOO
+ cmd <<="EOF"
+ foo
+ EOF
+ EOI
+ cmd <<=EOF
+ foo
+ EOF
+ EOO
+
+ : quoted-double-alias
+ :
+ $* <<EOI >>EOO
cmd <<"EOF"
foo
EOF
@@ -89,13 +149,13 @@
: basic
:
$* <<EOI >>EOO
- cmd <<EOF
+ cmd <<=EOF
foo
bar
baz
EOF
EOI
- cmd <<EOF
+ cmd <<=EOF
foo
bar
baz
@@ -105,14 +165,14 @@
: blank
:
$* <<EOI >>EOO
- cmd <<EOF
+ cmd <<=EOF
foo
bar
EOF
EOI
- cmd <<EOF
+ cmd <<=EOF
foo
@@ -123,11 +183,11 @@
: non-ws-prefix
:
$* <<EOI >>EOO
- cmd <<EOF
+ cmd <<=EOF
x EOF
EOF
EOI
- cmd <<EOF
+ cmd <<=EOF
x EOF
EOF
EOO
@@ -137,11 +197,11 @@
:
$* <<EOI >>EOO
x = foo bar
- cmd <<"EOF"
+ cmd <<="EOF"
$x
EOF
EOI
- cmd <<EOF
+ cmd <<=EOF
foo bar
EOF
EOO
@@ -151,11 +211,11 @@
:
$* <<EOI >>EOO
x = foo
- cmd <<"EOF"
+ cmd <<="EOF"
$x bar $x
EOF
EOI
- cmd <<EOF
+ cmd <<=EOF
foo bar foo
EOF
EOO
@@ -163,7 +223,7 @@
: unindented
:
$* <<EOI 2>>EOE != 0
- cmd <<EOF
+ cmd <<=EOF
bar
EOF
EOI
@@ -174,7 +234,7 @@
: blank
:
$* <<EOI >>EOO
-cmd <<EOF
+cmd <<=EOF
foo
@@ -182,7 +242,7 @@ bar
EOF
EOI
-cmd <<EOF
+cmd <<=EOF
foo
@@ -196,14 +256,14 @@ EOO
: Note: they are still recognized in eval contexts.
:
$* <<EOI >>EOO
-cmd <<"EOF"
+cmd <<="EOF"
'single'
"double"
b'o't"h"
('single' "double")
EOF
EOI
-cmd <<EOF
+cmd <<=EOF
'single'
"double"
b'o't"h"