blob: cc0bd7e1942a3d4ef99255a5ec3871dd0452f44b (
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
# file : unit-tests/test/script/parser/pipe-expr.test
# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
# license : MIT; see accompanying LICENSE file
: pipe
:
$* <<EOI >>EOO
cmd1 | cmd2|cmd3
EOI
cmd1 | cmd2 | cmd3
EOO
: log
:
$* <<EOI >>EOO
cmd1 || cmd2&&cmd3
EOI
cmd1 || cmd2 && cmd3
EOO
: pipe-log
:
$* <<EOI >>EOO
cmd1 | cmd2 && cmd3 | cmd4
EOI
cmd1 | cmd2 && cmd3 | cmd4
EOO
: exit
:
$* <<EOI >>EOO
cmd1|cmd2==1&&cmd3!=0|cmd4
EOI
cmd1 | cmd2 == 1 && cmd3 != 0 | cmd4
EOO
: here-doc
:
$* <<EOI >>EOO
cmd1 <<EOI1 | cmd2 >>EOO2 && cmd3 <<EOI3 2>&1 | cmd4 2>>EOE4 >>EOO4
input
one
EOI1
ouput
two
EOO2
input
three
EOI3
error
four
EOE4
output
four
EOO4
EOI
cmd1 <<EOI1 | cmd2 >>EOO2 && cmd3 <<EOI3 2>&1 | cmd4 >>EOO4 2>>EOE4
input
one
EOI1
ouput
two
EOO2
input
three
EOI3
output
four
EOO4
error
four
EOE4
EOO
: leading
:
$* <<EOI 2>>EOE != 0
| cmd
EOI
testscript:1:1: error: missing program
EOE
: trailing
:
$* <<EOI 2>>EOE != 0
cmd &&
EOI
testscript:1:7: error: missing program
EOE
|