diff options
Diffstat (limited to 'unit-tests/test/script/lexer/command-expansion.test')
-rw-r--r-- | unit-tests/test/script/lexer/command-expansion.test | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/unit-tests/test/script/lexer/command-expansion.test b/unit-tests/test/script/lexer/command-expansion.test new file mode 100644 index 0000000..f113846 --- /dev/null +++ b/unit-tests/test/script/lexer/command-expansion.test @@ -0,0 +1,134 @@ +test.arguments = command-expansion + +$* <:"0<+" >>EOO # in-pass-redirect +'0' +<+ +EOO + +$* <:"0 <+" >>EOO # arg-in-pass-redirect +'0 ' +<+ +EOO + +$* <:"1>+" >>EOO # out-pass-redirect +'1' +>+ +EOO + +$* <:"1 >+" >>EOO # arg-out-pass-redirect +'1 ' +>+ +EOO + +$* <:"0<-" >>EOO # in-null-redirect +'0' +<- +EOO + +$* <:"0 <-" >>EOO # arg-in-null-redirect +'0 ' +<- +EOO + +$* <:"1>-" >>EOO # out-null-redirect +'1' +>- +EOO + +$* <:"1 >-" >>EOO # arg-out-null-redirect +'1 ' +>- +EOO + +$* <:"1>&2" >>EOO # merge-redirect +'1' +>& +'2' +EOO + +$* <:"1 >&2" >>EOO # arg-merge-redirect +'1 ' +>& +'2' +EOO + +$* <:"0<a b" >>EOO # in-str-redirect +'0' +< +'a b' +EOO + +$* <:"1>a b" >>EOO # out-str-redirect +'1' +> +'a b' +EOO + +$* <:"0<:a b" >>EOO # in-str-nn-redirect +'0' +<: +'a b' +EOO + +$* <:"1>:a b" >>EOO # out-str-nn-redirect +'1' +>: +'a b' +EOO + +$* <:"0<<E O I" >>EOO # in-doc-redirect +'0' +<< +'E O I' +EOO + +$* <:"1>>E O O" >>EOO # out-doc-redirect +'1' +>> +'E O O' +EOO + +$* <:"0<<:E O I" >>EOO # in-doc-nn-redirect +'0' +<<: +'E O I' +EOO + +$* <:"1>>:E O O" >>EOO # out-doc-nn-redirect +'1' +>>: +'E O O' +EOO + +$* <:"0<<<a b" >>EOO # in-file-redirect +'0' +<<< +'a b' +EOO + +$* <:"1>>>a b" >>EOO # out-file-redirect +'1' +>>> +'a b' +EOO + +$* <:"1>>>&a b" >>EOO # out-file-app-redirect +'1' +>>>& +'a b' +EOO + +$* <:"&file" >>EOO # cleanup-always +& +'file' +EOO + +$* <:"&?file" >>EOO # cleanup-maybe +&? +'file' +EOO + +$* <:"&!file" >>EOO # cleanup-never +&! +'file' +EOO |