Results for ysh-builtin-error.test.sh

statusoshosh-cpp
pass 154
FAIL 011
total1515
caseoshosh-cppdescription
0pass pass try usage error
1pass FAIL try sets _status
details
2pass FAIL try with and without errexit
details
3pass FAIL try takes a block
details
4pass FAIL try with _pipeline_status and PIPESTATUS
details
5pass FAIL try with _process_sub_status
details
6pass FAIL try error handling idioms
details
7pass FAIL try can handled failed var, setvar, etc.
details
8pass FAIL try can handled failed expr sub
details
9pass FAIL try with failed command sub within expression
details
10pass FAIL try allows command sub (bug #1608)
details
11pass FAIL Uncaught expression error exits status 3
details
12pass pass boolstatus with external command
13pass pass boolstatus disallows procs with strict_errexit
14pass pass boolstatus can call a function without strict_errexit (not recommended)
19 passed, 0 OK, 0 not implemented, 0 BUG, 11 failed, 0 timeouts, 0 cases skipped

Details on runs that didn't PASS

osh-cpp1 try sets _status

[osh-cpp stdout] Expected 'myproc\ndollar=0\n_status=42\ndollar=9\n_status=42\n' Got 'myproc\ndollar=0\n_status=\ndollar=9\n_status=\n'

stdout:
myproc
dollar=0
_status=
dollar=9
_status=
stderr:
osh-cpp2 try with and without errexit

[osh-cpp stdout] Expected 'before\nstatus=1\n---\nblock\nbefore\nstatus=1\n===\nbefore\nstatus=1\n---\nblock\nbefore\nstatus=1\n' Got 'before\nstatus=\n---\nblock\nbefore\nstatus=\n===\nbefore\nstatus=\n---\nblock\nbefore\nstatus=\n'

stdout:
before
status=
---
block
before
status=
===
before
status=
---
block
before
status=
stderr:
osh-cpp3 try takes a block

[osh-cpp stdout] Expected 'myproc\ndollar=0\n_status=42\nmyproc\ndollar=0\n_status=42\n' Got 'myproc\ndollar=0\n_status=\nmyproc\ndollar=0\n_status=\n'

stdout:
myproc
dollar=0
_status=
myproc
dollar=0
_status=
stderr:
osh-cpp4 try with _pipeline_status and PIPESTATUS

[osh-cpp stdout] Expected '0\np 2 0\np 2 0\n_status=0\n---\n0\np 2 0\np 2 0\n_status=2\n' Got '0\np 2 0\np 2 0\n_status=\n---\n0\np 2 0\np 2 0\n_status=\n'

stdout:
0
p 2 0
p 2 0
_status=
---
0
p 2 0
p 2 0
_status=
stderr:
ls: cannot access '/bad': No such file or directory
ls: cannot access '/bad': No such file or directory
osh-cpp5 try with _process_sub_status

[osh-cpp stdout] Expected 'p 2 0\n_status=0\n---\np 2 0\n_status=2\n', got 'p 2 0\n_status=\n---\np 2 0\n_status=\n'

stdout:
p 2 0
_status=
---
p 2 0
_status=
stderr:
sort: cannot read: OOPS: No such file or directory
sort: cannot read: OOPS: No such file or directory
osh-cpp6 try error handling idioms

[osh-cpp stdout] Expected 'fail\n0\npipeline failed: 2 0\nprocess sub failed: 2 2\n' Got '0\n'

stdout:
0
stderr:
ls: cannot access '/nonexistent': No such file or directory
sort: cannot read: YY: No such file or directory
sort: cannot read: XX: No such file or directory
osh-cpp7 try can handled failed var, setvar, etc.

[osh-cpp stdout] Expected 'hi\ndiv 3\nindex 3\nkey 3\narrow 3\n', got 'hi\nshould not get here\ndiv\nshould not get here\nindex\nshould not get here\nkey\nshould not get here\narrow\n'

stdout:
hi
should not get here
div
should not get here
index
should not get here
key
should not get here
arrow
stderr:
osh-cpp8 try can handled failed expr sub

[osh-cpp stdout] Expected 'hi\n_status=3\n', got 'hi\nresult = \nshould not get here\n_status=\n'

stdout:
hi
result = 
should not get here
_status=
stderr:
osh-cpp9 try with failed command sub within expression

[osh-cpp stdout] Expected 'hi\ntry 42\n', got 'hi\nbye\ntry\n'

stdout:
hi
bye
try
stderr:
osh-cpp10 try allows command sub (bug #1608)

[osh-cpp stdout] Expected 'hi\n', got ''
[osh-cpp status] Expected 0, got 1

stdout:
stderr: 
  echo $x
       ^~
[ stdin ]:6: fatal: Undefined variable 'x'
osh-cpp11 Uncaught expression error exits status 3

[osh-cpp stdout] Expected 'outside=3\n', got 'inside=0\noutside=0\n'

stdout:
inside=0
outside=0
stderr: