# file : tests/test/script/runner/redirect.test # copyright : Copyright (c) 2014-2016 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file $* -o foo >- : out-null $* -e foo 2>- : err-null $* -i 0 foo : out-str $* -e foo 2>foo : err-str $* -i 1 foo : inout-str $* -i 2 foo : inerr-str $* -i 1 -e bar foo 2>bar : inout-err-str : in-doc : $* -i 0 <>EOO foo bar EOO : err-doc : $* -e foo -e bar 2>>EOO foo bar EOO : inout-doc : $* -i 1 <>EOO foo bar EOI foo bar EOO : inerr-doc : $* -i 2 <>EOE foo bar EOI foo bar EOE : empty-str-doc : $* -i 1 -e "" <>EOO 2>"" EOI EOO : nl-containing-doc : $* -i 1 <>EOO EOI EOO # No-newline tests. # # @@ TMP Need does not compare test. # : no-newline-str : $* -i 1 <:"foo" >:"foo" #\ $* -i 1 <:"foo" >!"foo" # no-newline-str-fail1 $* -i 1 <"foo" >:!"foo" # no-newline-str-fail2 #\ : no-newline-doc : $* -i 1 <<:EOI >>:EOO foo EOI foo EOO #\ $* -i 1 <<:EOI >>!EOO # no-newline-doc-fail1 foo EOI foo EOO $* -i 1 <>:!EOO # no-newline-doc-fail2 foo EOI foo EOO #\ : no-newline-empty-str-doc : $* -i 1 <<:EOI >>:EOO 2>:"" EOI EOO : no-newline-nl-cont-doc : $* -i 1 <<:EOI >>:EOO EOI EOO : file : $* -o foo >>>out; $* -e bar 2>>>&out; $* -i 1 <<>EOO foo bar EOO : merge-str : $* -o foo -e bar 2>>EOE 1>&2 foo bar EOE : merge-doc : $* -i 1 <>EOO 2>&1 foo bar EOI foo bar baz EOO : merge-file : $* -o foo -e bar 2>&1 >>>out; $* -e baz -o biz 1>&2 2>>>&out; $* -i 1 <<>EOO foo bar baz biz EOO # Builtins redirects. # # @@ That will probably become redundant when builtins and process obtain file # descriptors uniformly. # : builtins : { echo "abc" >- : out-null echo "abc" 1>&2 2>- : err-null echo - : in-str echo "foo" >foo : out-str echo "foo" 2>foo 1>&2 : err-str cat foo : inout-str cat foo 1>&2 : inerr-str }