-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathstatus.yaml
35 lines (29 loc) · 987 Bytes
/
status.yaml
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
name: "Status tests"
cases:
- name: "Basic status"
stdin: |
cat /non/existent >/dev/null
echo "[1] Status: $?; pipe status: ${PIPESTATUS[@]}"
- name: "Parse error status"
known_failure: true # Needs investigation
ignore_stderr: true
stdin: |
# Generate parse error
for f done
echo "[2] Status: $?; pipe status: ${PIPESTATUS[@]}"
- name: "Pipeline status"
stdin: |
/non/existent/program 2>/dev/null | cat
echo "Status: $?; pipe status: ${PIPESTATUS[@]}"
- name: "Command substitution status"
stdin: |
x=$(echo hi | wc -l)
echo "[1] Status: $?; pipe status: ${PIPESTATUS[@]}"
x=$(cat /non/existent 2>/dev/null)
echo "[2] Status: $?; pipe status: ${PIPESTATUS[@]}"
- name: "Subshell status"
stdin: |
(echo hi | wc -l)
echo "[1] Status: $?; pipe status: ${PIPESTATUS[@]}"
(cat /non/existent 2>/dev/null)
echo "[2] Status: $?; pipe status: ${PIPESTATUS[@]}"