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

Results for sh-options.test.sh

statusosh
pass 43
ok 1
N-I 2
FAIL 1
total47
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 can continue after unknown option
8pass set with both options and argv
9pass set -o vi/emacs
10pass vi and emacs are mutually exclusive
11pass interactive shell starts with emacs mode on
12pass nounset
13pass -u is nounset
14pass nounset with "$@"
15pass set -u -- clears argv
16pass set -u -- x y z
17pass reset option with long flag
18pass reset option with short flag
19pass set -eu (flag parsing)
20FAIL -n for no execution (useful with --ast-output)
details
21pass pipefail
22pass shopt -p -o prints 'set' options
23pass shopt -o prints 'set' options
24pass shopt -p prints 'shopt' options
25pass shopt with no flags prints options
26pass noclobber off
27pass noclobber on
28pass noclobber on <>
29ok set - -
details
30pass set -o lists options
31pass set without args lists variables
32pass 'set' and 'eval' round trip
33N-I set without args and array variables (not in OSH)
details
34N-I set without args and assoc array variables (not in OSH)
details
35pass shopt -q
36pass shopt -q invalid
37pass shopt -s strict:all
38pass shopt allows for backward compatibility like bash
39pass shopt -p validates option names
40pass shopt -p -o validates option names
41pass stubbed out bash options
42pass shopt -s nounset works in YSH, not in bash
43pass Unimplemented options - print, query, set, unset
44pass Unimplemented options - OSH shopt -s ignore_shopt_not_impl
45pass shopt -p exit code (regression)
46pass no-ops not shown by shopt -p
43 passed, 1 OK, 2 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 can continue after unknown option

stdout:
hello
stderr:
  set -o STRICT || true # unknown option
  ^~~
[ stdin ]:2: 'set' got invalid option 'STRICT'
osh8 set with both options and argv

stdout:
a b c
stderr:
osh9 set -o vi/emacs

stdout:
0
0
stderr:
osh10 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:
osh11 interactive shell starts with emacs mode on

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

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

stdout:
[]
stderr:
  echo "[$unset]"
         ^~~~~~
[ stdin ]:3: fatal: Undefined variable 'unset'
osh14 nounset with "$@"

stdout:
a b c
stderr:
osh15 set -u -- clears argv

stdout:
stderr: 
osh16 set -u -- x y z

stdout:
x y z
stderr:
osh17 reset option with long flag

stdout:
[]
stderr:
osh18 reset option with short flag

stdout:
[]
stderr:
osh19 set -eu (flag parsing)

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

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

stdout:
1
2
3
stderr:
osh21 pipefail

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

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

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

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

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

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

stdout:
create=0
overwrite=1
force=0
force
stderr:
  echo overwrite > no-clobber
                 ^
[ stdin ]:7: Can't open 'no-clobber': File exists (noclobber)
[ stdin ]:7: I/O error applying redirect: File exists
osh28 noclobber on <>

stdout:
f.o
stderr:
osh29 set - -

stdout:
a b
- a b
a b
- -
- +
+ -
--
stderr:
osh30 set -o lists options

stdout:
noexec
stderr:
osh31 set without args lists variables

stdout:
__GLOBAL=mutated
__OTHERLOCAL=L
__mylocal=L
__var_in_parent_scope=D
stderr:
osh32 'set' and 'eval' round trip

stdout:
[ ]
OK
OK
OK
OK
OK
stderr:
Code saved to /home/uke/oil/_tmp/spec-tmp/sh-options.test.sh/32-osh/vars-osh.txt
osh33 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: Assoc array keys must be strings: $x 'x' "$x" etc. (OILS-ERR-101)
osh35 shopt -q

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

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

stdout:
shopt -u strict_argv
shopt -u strict_arith
-
shopt -s strict_argv
shopt -s strict_arith
-
shopt -s strict_argv
shopt -u strict_arith
-
stderr:
osh38 shopt allows for backward compatibility like bash

stdout:
shopt -u nullglob
status=0
shopt -s nullglob
stderr:
osh39 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'
osh40 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'
osh41 stubbed out bash options

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

stdout:
status=0
set -o nounset
stderr:
osh43 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'
osh44 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:
osh45 shopt -p exit code (regression)

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

stdout:
--
stderr: