aboutsummaryrefslogtreecommitdiff
path: root/tests/test/script/runner/pipe.test
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-01-27 02:32:55 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-01-31 15:54:33 +0300
commit749f748ae6ded6e229214d2dddf3c45482bffbd3 (patch)
treec504c8b225db01c8c152b3772467d16c036a42fc /tests/test/script/runner/pipe.test
parente61a287832532124a1a90a8bb9cc0f61f3a4db92 (diff)
Add support for test command pipe, expression and command-if
Diffstat (limited to 'tests/test/script/runner/pipe.test')
-rw-r--r--tests/test/script/runner/pipe.test35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/test/script/runner/pipe.test b/tests/test/script/runner/pipe.test
new file mode 100644
index 0000000..bfbe8cb
--- /dev/null
+++ b/tests/test/script/runner/pipe.test
@@ -0,0 +1,35 @@
+# file : tests/test/script/runner/pipe.test
+# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+.include ../common.test
+
+$c <'cat <foo | $* -i 1 >foo' && $b : builtin-to-process
+$c <'$* -o foo | cat >foo' && $b : process-to-builtin
+
+
+: failure
+:
+: Note that while both commands for the pipe are faulty the diagnostics for
+: only the last one is printed.
+:
+{
+ : exit-code
+ :
+ $c <'$* -o foo -s 1 | $* -i 1 >foo -s 2' && $b 2>>/~%EOE% != 0
+ %testscript:1:1: error: .+ exit status 2 != 0%
+ info: stdout: test/1/stdout-2
+ EOE
+
+ : stderr
+ :
+ $c <'$* -o foo -e foo 2>bar | $* -i 2 2>baz' && $b 2>>/~%EOE% != 0
+ %testscript:1:1: error: .+ stderr doesn't match the expected output%
+ info: stderr: test/1/stderr-2
+ info: expected stderr: test/1/stderr-2.orig
+ info: stderr diff: test/1/stderr-2.diff
+ %.{3}
+ -baz
+ +foo
+ EOE
+}