diff options
Diffstat (limited to 'unit-tests')
-rw-r--r-- | unit-tests/test/script/lexer/command-expansion.test | 18 | ||||
-rw-r--r-- | unit-tests/test/script/lexer/command-line.test | 9 | ||||
-rw-r--r-- | unit-tests/test/script/parser/redirect.test | 9 |
3 files changed, 35 insertions, 1 deletions
diff --git a/unit-tests/test/script/lexer/command-expansion.test b/unit-tests/test/script/lexer/command-expansion.test index d405de6..ffbb944 100644 --- a/unit-tests/test/script/lexer/command-expansion.test +++ b/unit-tests/test/script/lexer/command-expansion.test @@ -68,6 +68,24 @@ test.arguments = command-expansion EOO } +: trace-redirect +: +{ + : out + : + $* <:"1>!" >>EOO + '1' + >! + EOO + + : arg-out + : + $* <:"1 >!" >>EOO + '1 ' + >! + EOO +} + : merge-redirect : { diff --git a/unit-tests/test/script/lexer/command-line.test b/unit-tests/test/script/lexer/command-line.test index 57fcfdf..adc8cd1 100644 --- a/unit-tests/test/script/lexer/command-line.test +++ b/unit-tests/test/script/lexer/command-line.test @@ -82,6 +82,15 @@ test.arguments = command-line <newline> EOO + : trace + : + $* <"cmd 1>!" >>EOO + 'cmd' + '1' + >! + <newline> + EOO + : merge : $* <"cmd 1>&2" >>EOO diff --git a/unit-tests/test/script/parser/redirect.test b/unit-tests/test/script/parser/redirect.test index 2e53c4d..4fc3a9d 100644 --- a/unit-tests/test/script/parser/redirect.test +++ b/unit-tests/test/script/parser/redirect.test @@ -2,10 +2,17 @@ # copyright : Copyright (c) 2014-2017 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file -# @@ Add tests for redirects other than file and merge. +# @@ Add tests for redirects other than trace, here-*, file and merge. # @@ Does it make sense to split into separate files - one per redirect type? # +: trace +: +{ + $* <'cmd >!' >'cmd >!' : out + $* <'cmd 2>!' >'cmd 2>!' : err +} + : str : { |