aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/test/script/parser+redirect.test.testscript
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-09-17 16:00:20 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-09-19 17:46:46 +0300
commit6e84c0f9c5e4d7d98d2a352eec6bc19de0d75d28 (patch)
treeaa022efe5a906e6f0272b823c7829cdfe3e39eb8 /libbuild2/test/script/parser+redirect.test.testscript
parent8c30c59de2d304a416dfd4fcb821e0b227e5db96 (diff)
Fix crashing on testscript command redirect overrides
Diffstat (limited to 'libbuild2/test/script/parser+redirect.test.testscript')
-rw-r--r--libbuild2/test/script/parser+redirect.test.testscript86
1 files changed, 86 insertions, 0 deletions
diff --git a/libbuild2/test/script/parser+redirect.test.testscript b/libbuild2/test/script/parser+redirect.test.testscript
index a8691da..49fa89b 100644
--- a/libbuild2/test/script/parser+redirect.test.testscript
+++ b/libbuild2/test/script/parser+redirect.test.testscript
@@ -167,6 +167,92 @@
}
}
}
+
+ : overriding
+ :
+ {
+ : literal
+ :
+ {
+ : with
+ :
+ {
+ : string
+ :
+ $* <<EOI >>EOO
+ cmd >>EOF >bar
+ foo
+ EOF
+ EOI
+ cmd >bar
+ EOO
+
+ : regex
+ :
+ $* <<EOI >>EOO
+ cmd >>FOO >>~/BAR/
+ foo
+ FOO
+ bar
+ BAR
+ EOI
+ cmd >>~/BAR/
+ bar
+ BAR
+ EOO
+
+ : self
+ :
+ $* <<EOI >>EOO
+ cmd >>EOF >>EOF
+ foo
+ EOF
+ EOI
+ cmd >>EOF
+ foo
+ EOF
+ EOO
+
+ : different-modifiers
+ :
+ $* <<EOI 2>>EOE != 0
+ cmd >>EOF >>/EOF
+ foo
+ EOF
+ EOI
+ testscript:1:14: error: different modifiers for shared here-document 'EOF'
+ EOE
+ }
+ }
+
+ : shared
+ :
+ {
+ : after-sharing
+ :
+ $* <<EOI >>EOO
+ cmd >>EOF 2>>EOF >bar
+ foo
+ EOF
+ EOI
+ cmd >bar 2>>EOF
+ foo
+ EOF
+ EOO
+
+ : before-sharing
+ :
+ $* <<EOI >>EOO
+ cmd >>EOF >bar 2>>EOF
+ foo
+ EOF
+ EOI
+ cmd >bar 2>>EOF
+ foo
+ EOF
+ EOO
+ }
+ }
}
: file