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

Results for sh-usage.test.sh

statusosh
pass 22
ok 2
total24
caseoshdescription
0pass sh -c
1pass empty -c input
2pass sh +c is accepted
3pass empty stdin
4ok sh - and sh -- stop flag processing
details
5pass shell obeys --help (regression for OSH)
6pass args are passed
7pass args that look like flags are passed after script
8pass args that look like flags are passed after -c
9pass exit with explicit arg
10pass exit with no args
11pass --rcfile in non-interactive shell prints warnings
12pass accepts -l flag
13pass accepts --login flag (dash and mksh don't accept long flags)
14pass osh --eval
15pass Set LC_ALL LC_CTYPE LC_COLLATE LANG - affects glob ?
16pass LC_CTYPE=invalid
17pass sh -c -- 'echo hi' does not run anything (#2637)
18pass sh -c with multiple -- args
19pass sh -c with no arg after --
20pass Other flag parsers are not affected by - rule
21pass weird flag parsing -oo errexit noglob
22pass 'sh -c -z' does not try to run -z
23ok sh -c -x 'echo hi' - order is reversed
details
22 passed, 2 OK, 0 not implemented, 0 BUG, 0 failed, 0 timeouts, 0 cases skipped

Details on runs that didn't PASS

osh0 sh -c

stdout:
hi
stderr:
osh1 empty -c input

stdout:
stderr: 
osh2 sh +c is accepted

stdout:
hi
stderr:
osh3 empty stdin

stdout:
stderr: 
osh4 sh - and sh -- stop flag processing

stdout:
foo
-
foo
stderr:
+ echo foo
-
+ echo foo
osh5 shell obeys --help (regression for OSH)

stdout:
yes
stderr:
osh6 args are passed

stdout:
['a', 'b']
stderr:
osh7 args that look like flags are passed after script

stdout:
['--help', '--help', '-h']
stderr:
osh8 args that look like flags are passed after -c

stdout:
['--help', '-h']
stderr:
osh9 exit with explicit arg

stdout:
stderr: 
osh10 exit with no args

stdout:
stderr: 
osh11 --rcfile in non-interactive shell prints warnings

stdout:
rc
^D
==> interactive.txt <==
osh-0.37$ 
==> non-interactive.txt <==
osh warning: --rcfile ignored in non-interactive shell
stderr:
warned=1
warned=0
osh12 accepts -l flag

stdout:
stderr: 
osh13 accepts --login flag (dash and mksh don't accept long flags)

stdout:
stderr: 
osh14 osh --eval

stdout:
one x y z
status=0 flag -c x y z

one x y z
fail x y z
status=42 flag -c x y z
status=0
stderr:
osh15 Set LC_ALL LC_CTYPE LC_COLLATE LANG - affects glob ?

stdout:
LC_ALL _x_
LC_ALL _x_ _μ_

LC_CTYPE _x_
LC_CTYPE _x_ _μ_

LC_COLLATE _x_
LC_COLLATE _x_

LANG _x_
LANG _x_ _μ_
stderr:
osh16 LC_CTYPE=invalid

stdout:
LC_CTYPE _x_
1 err.txt
stderr:
osh17 sh -c -- 'echo hi' does not run anything (#2637)

stdout:
z failed

three failed

two
two=0

one
one=0

zero=0

aa
aa=0
stderr:
osh usage error: got invalid flag '-z'
osh usage error: got invalid flag '---'
osh18 sh -c with multiple -- args

stdout:
status=127
status=127
z failed
stderr:
  --
  ^~
[ -c flag ]:1: Command '--' not found (OILS-ERR-100)
  --
  ^~
[ -c flag ]:1: Command '--' not found (OILS-ERR-100)
osh usage error: got invalid flag '-z'
osh19 sh -c with no arg after --

stdout:
failed
failed
stderr:
osh usage error: expected argument to '-c'
osh usage error: expected argument to '-c'
osh20 Other flag parsers are not affected by - rule

stdout:
reply=foo
stderr:
osh21 weird flag parsing -oo errexit noglob

stdout:
e
f
e
f
stderr:
osh22 'sh -c -z' does not try to run -z

stdout:
flag-parsing-error
0=-z 1=
status=0
0=foo 1=-z
status=0
stderr:
osh usage error: got invalid flag '-z'
osh23 sh -c -x 'echo hi' - order is reversed

stdout:
hi
status=1
stderr:
+ echo hi
+ 'false'