Results for strict-options.test.sh

casedashbashmkshoshosh_ALTosh-byterundescription
0pass pass pass pass pass pass Sourcing a script that returns at the top level
1pass ok pass pass pass pass top level control flow
details
2pass ok pass pass pass pass errexit and top-level control flow
details
3N-I N-I N-I pass pass pass set -o strict-control-flow
detailsdetailsdetails
4pass ok pass pass pass pass return at top level is an error
details
5pass pass pass pass pass pass continue at top level is NOT an error
6pass pass pass pass pass pass break at top level is NOT an error

36 passed, 3 ok, 3 known unimplemented, 0 known bugs, 0 failed, 0 skipped

Details on runs that didn't PASS

bash1 top level control flow

stdout:
SUBSHELL
BREAK
CONTINUE
RETURN
DONE
stderr:
spec/testdata/top-level-control-flow.sh: line 14: return: can only `return' from a function or sourced script
spec/testdata/top-level-control-flow.sh: line 17: break: only meaningful in a `for', `while', or `until' loop
spec/testdata/top-level-control-flow.sh: line 19: continue: only meaningful in a `for', `while', or `until' loop
spec/testdata/top-level-control-flow.sh: line 24: return: can only `return' from a function or sourced script
bash2 errexit and top-level control flow

stdout:
SUBSHELL
stderr:
spec/testdata/top-level-control-flow.sh: line 14: return: can only `return' from a function or sourced script
dash3 set -o strict-control-flow

stdout:
stderr: 
_tmp/spec-bin/dash: 0: Illegal option -o strict-control-flow
bash3 set -o strict-control-flow

stdout:
stderr: 
_tmp/spec-bin/bash: line 0: _tmp/spec-bin/bash: strict-control-flow: invalid option name
mksh3 set -o strict-control-flow

stdout:
stderr: 
_tmp/spec-bin/mksh: strict-control-flow: bad option
bash4 return at top level is an error

stdout:
status=1
stderr:
_tmp/spec-bin/bash: line 1: return: can only `return' from a function or sourced script