aboutsummaryrefslogtreecommitdiff
path: root/tests/test/script/runner/pipe.test
blob: bfbe8cbf44b0d86793314cc0587080da13384438 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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
}