Results for sh-options.test.sh

casedashbashmkshoshosh_ALTdescription
0pass ok ok pass pass $- with -c
detailsdetails
1N-I ok ok pass pass $- with pipefail
detailsdetailsdetails
2pass pass pass pass pass sh -c
3pass pass pass pass pass empty -c input
4pass pass pass pass pass empty stdin
5pass pass pass pass pass args are passed
6pass pass pass pass pass args that look like flags are passed after script
7pass pass pass pass pass args that look like flags are passed after -c
8pass pass pass pass pass pass short options on command line
9pass pass pass pass pass pass long options on command line
10BUG pass BUG pass pass can continue after unknown option
detailsdetails
11pass pass pass pass pass set with both options and argv
12ok pass pass pass pass nounset
details
13ok pass pass pass pass -u is nounset
details
14pass pass pass pass pass nounset with "$@"
15pass pass pass pass pass set -u -- clears argv
16pass pass pass pass pass set -u -- x y z
17pass pass pass pass pass reset option with long flag
18pass pass pass pass pass reset option with short flag
19ok pass pass pass pass set -eu (flag parsing)
details
20pass pass pass FAIL FAIL -n for no execution (useful with --ast-output)
detailsdetails
21N-I pass pass pass pass pipefail
details
22N-I pass N-I pass pass shopt -p -o
detailsdetails
23N-I pass N-I pass pass shopt -p
detailsdetails
24pass pass pass pass pass noclobber off
25ok pass pass FAIL FAIL noclobber on
detailsdetailsdetails
26N-I pass N-I pass pass SHELLOPTS is updated when options are changed
detailsdetails
27N-I pass N-I FAIL FAIL SHELLOPTS is readonly
detailsdetailsdetailsdetails

114 passed, 8 ok, 10 known unimplemented, 2 known bugs, 3 failed, 0 skipped

Details on runs that didn't PASS

bash0 $- with -c

stdout:
huBc
stderr:
mksh0 $- with -c

stdout:
uhc
stderr:
dash1 $- with pipefail

stdout:
stderr: 
/bin/dash: 1: set: Illegal option -o pipefail
bash1 $- with pipefail

stdout:
huB
stderr:
mksh1 $- with pipefail

stdout:
ush
stderr:
dash10 can continue after unknown option

stdout:
stderr: 
/bin/dash: 2: set: Illegal option -o STRICT
mksh10 can continue after unknown option

stdout:
stderr: 
/bin/mksh: <stdin>[2]: set: STRICT: bad option
dash12 nounset

stdout:
[]
stderr:
/bin/dash: 3: unset: parameter not set
dash13 -u is nounset

stdout:
[]
stderr:
/bin/dash: 3: unset: parameter not set
dash19 set -eu (flag parsing)

stdout:
stderr: 
/bin/dash: 2: unset: parameter not set
osh20 -n for no execution (useful with --ast-output)

[osh stdout] Expected u'1\n', got '1\n2\n3\n'

stdout:
1
2
3
stderr:
osh_ALT20 -n for no execution (useful with --ast-output)

[osh_ALT stdout] Expected u'1\n', got '1\n2\n3\n'

stdout:
1
2
3
stderr:
dash21 pipefail

stdout:
0
stderr:
/bin/dash: 3: set: Illegal option -o pipefail
dash22 shopt -p -o

stdout:
stderr: 
/bin/dash: 1: shopt: not found
/bin/dash: 3: shopt: not found
mksh22 shopt -p -o

stdout:
stderr: 
/bin/mksh: <stdin>[1]: shopt: not found
/bin/mksh: <stdin>[3]: shopt: not found
dash23 shopt -p

stdout:
stderr: 
/bin/dash: 1: shopt: not found
/bin/dash: 2: shopt: not found
/bin/dash: 3: shopt: not found
mksh23 shopt -p

stdout:
stderr: 
/bin/mksh: <stdin>[1]: shopt: not found
/bin/mksh: <stdin>[2]: shopt: not found
/bin/mksh: <stdin>[3]: shopt: not found
dash25 noclobber on

stdout:
0
2
stderr:
/bin/dash: 5: cannot create /home/andy/git/oilshell/oil/_tmp/spec-tmp/no-clobber: File exists
osh25 noclobber on

[osh stdout] Expected u'0\n1\n', got '0\n0\n'

stdout:
0
0
stderr:
osh_ALT25 noclobber on

[osh_ALT stdout] Expected u'0\n1\n', got '0\n0\n'

stdout:
0
0
stderr:
dash26 SHELLOPTS is updated when options are changed

stdout:
1
1
1
stderr:
+ + echo
grep -q xtrace
+ echo 1
+ set +x
mksh26 SHELLOPTS is updated when options are changed

stdout:
1
1
1
stderr:
+ grep -q xtrace
+ echo
+ echo 1
+ set +x
dash27 SHELLOPTS is readonly

stdout:
status=0
stderr:
mksh27 SHELLOPTS is readonly

stdout:
status=0
stderr:
osh27 SHELLOPTS is readonly

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

stdout:
stderr: 
*** Error has no source location info ***
osh failed: Can't assign to readonly value 'SHELLOPTS'
osh_ALT27 SHELLOPTS is readonly

[osh_ALT stdout] Expected 'status=1\n', got ''
[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
*** Error has no source location info ***
osh failed: Can't assign to readonly value 'SHELLOPTS'