Results for sh-options.test.sh

statusoshosh-cpp
pass 3838
ok 22
N-I 22
FAIL 22
total4444
caseoshosh-cppdescription
0pass pass $- with -c
1pass pass $- with pipefail
2pass pass $- and more options
3pass pass $- with interactive shell
4pass pass pass short options like sh -e
5pass pass pass long options like sh -o errexit
6pass pass pass shopt options like sh -O nullglob
7pass pass can continue after unknown option
8pass pass set with both options and argv
9pass pass set -o vi/emacs
10pass pass vi and emacs are mutually exclusive
11pass pass interactive shell starts with emacs mode on
12pass pass nounset
13pass pass -u is nounset
14pass pass nounset with "$@"
15pass pass set -u -- clears argv
16pass pass set -u -- x y z
17pass pass reset option with long flag
18pass pass reset option with short flag
19pass pass set -eu (flag parsing)
20FAIL FAIL -n for no execution (useful with --ast-output)
detailsdetails
21pass pass pipefail
22pass pass shopt -p -o prints 'set' options
23pass pass shopt -p prints 'shopt' options
24pass pass shopt with no flags prints options
25pass pass noclobber off
26FAIL FAIL noclobber on
detailsdetails
27pass pass SHELLOPTS is updated when options are changed
28ok ok SHELLOPTS is readonly
detailsdetails
29ok ok set - -
detailsdetails
30pass pass set -o lists options
31pass pass set without args lists variables
32pass pass 'set' and 'eval' round trip
33N-I N-I set without args and array variables (not in OSH)
detailsdetails
34N-I N-I set without args and assoc array variables (not in OSH)
detailsdetails
35pass pass shopt -q
36pass pass shopt -q invalid
37pass pass shopt -s strict:all
38pass pass shopt allows for backward compatibility like bash
39pass pass shopt -p validates option names
40pass pass shopt -p -o validates option names
41pass pass stubbed out bash options
42pass pass shopt -s nounset works in Oil, not in bash
43pass pass no-ops not in shopt -p output
76 passed, 4 OK, 4 not implemented, 0 BUG, 4 failed, 0 timeouts, 0 cases skipped
2 failed under osh

Details on runs that didn't PASS

osh20 -n for no execution (useful with --ast-output)

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

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

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

stdout:
1
2
3
stderr:
osh26 noclobber on

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

stdout:
0
0
stderr:
rm: cannot remove '/home/andy/git/oilshell/oil/_tmp/spec-tmp/sh-options.test.sh.3393/26-osh/no-clobber': No such file or directory
osh-cpp26 noclobber on

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

stdout:
0
0
stderr:
rm: cannot remove '/home/andy/git/oilshell/oil/_tmp/spec-tmp/sh-options.test.sh.3393/26-osh-cpp/no-clobber': No such file or directory
osh28 SHELLOPTS is readonly

stdout:
stderr: 
  SHELLOPTS=x
  ^~~~~~~~~~
[ stdin ]:1: fatal: Can't assign to readonly value 'SHELLOPTS'
osh-cpp28 SHELLOPTS is readonly

stdout:
stderr: 
  SHELLOPTS=x
  ^~~~~~~~~~
[ stdin ]:1: fatal: Can't assign to readonly value 'SHELLOPTS'
osh29 set - -

stdout:
a b
- a b
a b
- -
- +
+ -
--
stderr:
osh-cpp29 set - -

stdout:
a b
- a b
a b
- -
- +
+ -
--
stderr:
osh33 set without args and array variables (not in OSH)

stdout:
stderr: 
osh-cpp33 set without args and array variables (not in OSH)

stdout:
stderr: 
osh34 set without args and assoc array variables (not in OSH)

stdout:
stderr: 
  __assoc[a]=b
  ^~~~~~~~
[ stdin ]:3: fatal: Associative array keys must be strings: $x 'x' "$x" etc.
osh-cpp34 set without args and assoc array variables (not in OSH)

stdout:
stderr: 
  __assoc[a]=b
  ^~~~~~~~
[ stdin ]:3: fatal: Associative array keys must be strings: $x 'x' "$x" etc.