sh-func () { run-file sh-func "$@" } run-file () { local spec_name=$1; shift; sh-spec spec/$spec_name.test.sh --compare-shells --oils-bin-dir $PWD/bin "$@" } sh-func: spec test case results

Results for sh-func.test.sh

statusbashdashmkshosh
pass 10101010
ok 0100
BUG 1010
FAIL 0001
total11111111
casebashdashmkshoshdescription
0pass pass pass pass Locals don't leak
1pass pass pass pass Globals leak
2pass pass pass pass Return statement
3pass pass pass pass Dynamic Scope
4pass pass pass pass Dynamic Scope Mutation (wow this is bad)
5pass pass pass pass Assign local separately
6pass pass pass pass Assign a local and global on same line
7pass pass pass pass Return without args gives previous
8BUG ok BUG pass return "" (a lot of disagreement)
detailsdetailsdetails
9pass pass pass pass return $empty
10pass pass pass FAIL Subshell function
details
40 passed, 1 OK, 0 not implemented, 2 BUG, 1 failed, 0 timeouts, 0 cases skipped
1 failed under osh

Details on runs that didn't PASS

bash8 return "" (a lot of disagreement)

stdout:
f
status=2
stderr:
main: line 3: return: : numeric argument required
dash8 return "" (a lot of disagreement)

stdout:
f
stderr:
dash: 3: return: Illegal number: 
mksh8 return "" (a lot of disagreement)

stdout:
f
status=1
stderr:
mksh: <stdin>[6]: return: : bad number
osh10 Subshell function

[osh stdout] Expected 'status=42\nstatus=42\n', got 'status=42\n'
[osh status] Expected 0, got 1

stdout:
status=42
stderr:
  g() ( return 42 )
        ^~~~~~
[ stdin ]:2: fatal: Invalid control flow 'return' in pipeline / subshell / background