/home/uke/oil/bin/osh sh-options: spec test case results

Results for sh-options.test.sh

statusosh
pass 37
N-I 1
FAIL 1
total39
caseoshdescription
0pass $- with -c
1pass $- with pipefail
2pass $- and more options
3pass $- with interactive shell
4pass pass short options like sh -e
5pass pass long options like sh -o errexit
6pass pass shopt options like sh -O nullglob
7pass set -o vi/emacs
8pass vi and emacs are mutually exclusive
9pass interactive shell starts with emacs mode on
10pass nounset
11pass -u is nounset
12FAIL -n for no execution (useful with --ast-output)
details
13pass pipefail
14pass shopt -p -o prints 'set' options
15pass shopt -o prints 'set' options
16pass shopt -p prints 'shopt' options
17pass shopt with no flags prints options
18pass noclobber off
19pass noclobber on
20pass noclobber on <>
21pass noclobber on >>
22pass noclobber on &> >
23pass noclobber on &>> >>
24pass set without args lists variables
25pass set without args and array variables
26N-I set without args and assoc array variables (not in OSH)
details
27pass shopt -q
28pass shopt -q invalid
29pass shopt -s strict:all
30pass shopt allows for backward compatibility like bash
31pass shopt -p validates option names
32pass shopt -p -o validates option names
33pass stubbed out bash options
34pass shopt -s nounset works in YSH, not in bash
35pass Unimplemented options - print, query, set, unset
36pass Unimplemented options - OSH shopt -s ignore_shopt_not_impl
37pass shopt -p exit code (regression)
38pass no-ops not shown by shopt -p
37 passed, 0 OK, 1 not implemented, 0 BUG, 1 failed, 0 timeouts, 0 cases skipped
1 failed under osh

Details on runs that didn't PASS

osh0 $- with -c

stdout:
u
stderr:
osh1 $- with pipefail

stdout:
u
stderr:
osh2 $- and more options

stdout:
yes
yes
yes
yes
stderr:
osh3 $- with interactive shell

stdout:
FALSE
TRUE
stderr:
osh4 pass short options like sh -e

stdout:
stderr: 
osh5 pass long options like sh -o errexit

stdout:
stderr: 
osh6 pass shopt options like sh -O nullglob

stdout:
foo *.nonexistent bar
foo bar
stderr:
osh7 set -o vi/emacs

stdout:
0
0
stderr:
osh8 vi and emacs are mutually exclusive

stdout:
set +o emacs
set +o vi
___
set -o emacs
set +o vi
___
set +o emacs
set -o vi
___
stderr:
osh9 interactive shell starts with emacs mode on

stdout:
non-interactive
1
1
interactive
0
1
stderr:
osh warning: --rcfile ignored in non-interactive shell
osh10 nounset

stdout:
[]
stderr:
  echo "[$unset]"
         ^~~~~~
[ stdin ]:3: fatal: Undefined variable 'unset'
osh11 -u is nounset

stdout:
[]
stderr:
  echo "[$unset]"
         ^~~~~~
[ stdin ]:3: fatal: Undefined variable 'unset'
osh12 -n for no execution (useful with --ast-output)

[osh stdout] Expected '1\n' Got '1\n2\n3\n'

stdout:
1
2
3
stderr:
osh13 pipefail

stdout:
0
2
stderr:
osh14 shopt -p -o prints 'set' options

stdout:
set +o nounset
set -o nounset
--
errexit
noglob
nounset
stderr:
osh15 shopt -o prints 'set' options

stdout:
errexit
noglob
nounset
--
stderr:
osh16 shopt -p prints 'shopt' options

stdout:
shopt -u nullglob
shopt -s nullglob
stderr:
osh17 shopt with no flags prints options

stdout:
2 one.txt
nullglob
failglob
1
stderr:
osh18 noclobber off

stdout:
status=0
status=0
status=0
foo
stderr:
osh19 noclobber on

stdout:
create=0
overwrite=1
force=0
force
stderr:
[ stdin ]:7: I/O error applying redirect: File exists
osh20 noclobber on <>

stdout:
f.o
stderr:
osh21 noclobber on >>

stdout:
status=0
foo
stderr:
osh22 noclobber on &> >

stdout:
stdout=0
again=1
foo
both=0
again=1
baz
stderr:
[ stdin ]:8: I/O error applying redirect: File exists
[ stdin ]:15: I/O error applying redirect: File exists
osh23 noclobber on &>> >>

stdout:
stdout=0
again=0
foo
bar
both=0
again=0
baz
foo
stderr:
osh24 set without args lists variables

stdout:
__GLOBAL=mutated
__OTHERLOCAL=L
__mylocal=L
__var_in_parent_scope=D
stderr:
osh25 set without args and array variables

stdout:
__array=(1 2 '3 4')
stderr:
osh26 set without args and assoc array variables (not in OSH)

stdout:
stderr: 
  __assoc[a]=b
  ^~~~~~~~
[ stdin ]:3: fatal: Assoc array keys must be strings: $x 'x' "$x" etc. (OILS-ERR-101)
osh27 shopt -q

stdout:
nullglob=1
nullglob=0
nullglob,failglob=1
nullglob,failglob=0
stderr:
osh28 shopt -q invalid

stdout:
invalidZZ=2
stderr:
osh29 shopt -s strict:all

stdout:
shopt -u strict_arg_parse
shopt -u strict_argv
-
shopt -s strict_arg_parse
shopt -s strict_argv
-
shopt -s strict_arg_parse
shopt -u strict_argv
-
stderr:
osh30 shopt allows for backward compatibility like bash

stdout:
shopt -u nullglob
status=0
shopt -s nullglob
stderr:
osh31 shopt -p validates option names

stdout:
status=2
status=2
stderr:
  shopt -p nullglob invalid failglob
  ^~~~~
[ stdin ]:1: 'shopt' got invalid option 'invalid'
  shopt nullglob invalid failglob > $TMP/out.txt
  ^~~~~
[ stdin ]:3: 'shopt' got invalid option 'invalid'
osh32 shopt -p -o validates option names

stdout:
set +o errexit
status=2
stderr:
  shopt -p -o errexit invalid nounset
  ^~~~~
[ stdin ]:1: 'shopt' got invalid option 'invalid'
osh33 stubbed out bash options

stdout:
2
0
0
0
stderr:
    shopt -s $name
    ^~~~~
[ stdin ]:3: 'shopt' got invalid option 'foo'
osh34 shopt -s nounset works in YSH, not in bash

stdout:
status=0
set -o nounset
stderr:
osh35 Unimplemented options - print, query, set, unset

stdout:
q=2
p=2
noflag=2
set=1
stderr:
  shopt -p xpg_echo
  ^~~~~
[ stdin ]:5: 'shopt' got invalid option 'xpg_echo'
  shopt -s xpg_echo
  ^~~~~
[ stdin ]:8: 'shopt' got invalid option 'xpg_echo'
  shopt -p xpg_echo
  ^~~~~
[ stdin ]:9: 'shopt' got invalid option 'xpg_echo'
  shopt -u xpg_echo
  ^~~~~
[ stdin ]:11: 'shopt' got invalid option 'xpg_echo'
  shopt -p xpg_echo
  ^~~~~
[ stdin ]:12: 'shopt' got invalid option 'xpg_echo'
  shopt xpg_echo >/dev/null
  ^~~~~
[ stdin ]:15: 'shopt' got invalid option 'xpg_echo'
osh36 Unimplemented options - OSH shopt -s ignore_shopt_not_impl

stdout:
shopt -u xpg_echo
q=1
shopt -s xpg_echo
shopt -u xpg_echo
p=1
noflag=1
set=1
stderr:
osh37 shopt -p exit code (regression)

stdout:
status=0
stderr:
osh38 no-ops not shown by shopt -p

stdout:
--
stderr: