Results for builtin-special.test.sh

statusoshosh-cpp
pass 55
ok 11
BUG-2 11
FAIL 33
total1010
caseoshosh-cppdescription
0pass pass true is not special; prefix assignments don't persist, it can be redefined
1pass pass Prefix assignments persist after special builtins, like : (set -o posix)
2ok ok readonly is special and prefix assignments persist (set -o posix)
detailsdetails
3BUG-2 BUG-2 Which shells allow special builtins to be redefined?
detailsdetails
4FAIL FAIL Special builtins can't be redefined as shell functions (set -o posix)
detailsdetails
5pass pass Non-special builtins CAN be redefined as functions
6FAIL FAIL Shift is special and fails whole script
detailsdetails
7FAIL FAIL set is special and fails whole script, even if using || true
detailsdetails
8pass pass bash 'type' gets confused - says 'function', but runs builtin
9pass pass command, builtin - both can be redefined, not special (regression)
10 passed, 2 OK, 0 not implemented, 2 BUG, 3 failed, 0 timeouts, 0 cases skipped
3 failed under osh

Details on runs that didn't PASS

osh2 readonly is special and prefix assignments persist (set -o posix)

stdout:
foo=bar
spam=eggs
bar
None
stderr:
osh-cpp2 readonly is special and prefix assignments persist (set -o posix)

stdout:
foo=bar
spam=eggs
bar
None
stderr:
osh3 Which shells allow special builtins to be redefined?

stdout:
hi
stderr:
osh-cpp3 Which shells allow special builtins to be redefined?

stdout:
hi
stderr:
osh4 Special builtins can't be redefined as shell functions (set -o posix)

[osh stdout] Expected 'hi\n', got 'hi\nhi\n'
[osh status] Expected 2, got 0

stdout:
hi
hi
stderr:
osh-cpp4 Special builtins can't be redefined as shell functions (set -o posix)

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

stdout:
hi
hi
stderr:
osh6 Shift is special and fails whole script

[osh stdout] Expected 'non-zero status\n', got 'status=1\n'

stdout:
status=1
stderr:
osh-cpp6 Shift is special and fails whole script

[osh-cpp stdout] Expected 'non-zero status\n', got 'status=1\n'

stdout:
status=1
stderr:
osh7 set is special and fails whole script, even if using || true

[osh stdout] Expected 'ok\nnon-zero status\n', got 'ok\nshould not get here\n'

stdout:
ok
should not get here
stderr:
  shopt -s invalid_ || true
  ^~~~~
[ -c flag ]:6: 'shopt' got invalid option 'invalid_'
  set -o invalid_ || true
  ^~~
[ -c flag ]:8: 'set' got invalid option 'invalid_'
osh-cpp7 set is special and fails whole script, even if using || true

[osh-cpp stdout] Expected 'ok\nnon-zero status\n', got 'ok\nshould not get here\n'

stdout:
ok
should not get here
stderr:
  shopt -s invalid_ || true
  ^~~~~
[ -c flag ]:6: 'shopt' got invalid option 'invalid_'
  set -o invalid_ || true
  ^~~
[ -c flag ]:8: 'set' got invalid option 'invalid_'