Results for builtin-getopts.test.sh

casedashbashmkshashoshosh_ALTdescription
0pass pass pass pass pass pass getopts empty
1pass pass pass pass pass pass getopts sees unknown arg
2pass pass pass pass pass pass getopts three invocations
3pass pass pass pass pass pass getopts resets OPTARG
4pass pass pass pass pass pass Basic getopts invocation
5pass pass pass pass pass pass getopts with invalid flag
6pass pass pass pass pass pass getopts missing required argument
7pass pass pass pass pass pass getopts doesn't look for flags after args
8pass pass pass pass FAIL FAIL getopts with explicit args
detailsdetails
9pass pass pass pass pass pass OPTIND
10pass pass BUG pass BUG BUG OPTIND after multiple getopts with same spec
detailsdetailsdetails
11BUG pass BUG BUG BUG BUG OPTIND after multiple getopts with different spec
detailsdetailsdetailsdetailsdetails
12pass BUG BUG pass BUG BUG OPTIND narrowed down
detailsdetailsdetailsdetails
13pass pass pass pass pass pass Getopts parses the function's arguments

70 passed, 0 ok, 0 known unimplemented, 12 known bugs, 1 failed, 0 skipped

Details on runs that didn't PASS

osh8 getopts with explicit args

[osh stdout] Expected 'h=1 c=foo optind=4 argv=\n', got 'h=0 c= optind=1 argv=\n'

stdout:
h=0 c= optind=1 argv=
stderr:
osh_ALT8 getopts with explicit args

[osh_ALT stdout] Expected 'h=1 c=foo optind=4 argv=\n', got 'h=0 c= optind=1 argv=\n'

stdout:
h=0 c= optind=1 argv=
stderr:
mksh10 OPTIND after multiple getopts with same spec

stdout:
1
-
-
4
4
stderr:
/bin/mksh: <stdin>[13]: getopts: arguments changed since last call
osh10 OPTIND after multiple getopts with same spec

stdout:
1
-
-
4
4
stderr:
osh_ALT10 OPTIND after multiple getopts with same spec

stdout:
1
-
-
4
4
stderr:
dash11 OPTIND after multiple getopts with different spec

stdout:
.
2
-
-
-
5
_
2
stderr:
No arg for -f option
mksh11 OPTIND after multiple getopts with different spec

stdout:
.
2
-
-
5
5
stderr:
/bin/mksh: <stdin>[14]: getopts: arguments changed since last call
ash11 OPTIND after multiple getopts with different spec

stdout:
.
2
-
-
-
5
_
2
stderr:
No arg for -f option
osh11 OPTIND after multiple getopts with different spec

stdout:
.
2
-
-
5
5
stderr:
osh_ALT11 OPTIND after multiple getopts with different spec

stdout:
.
2
-
-
5
5
stderr:
bash12 OPTIND narrowed down

stdout:
a=1 b= c= d=1 e=E
stderr:
mksh12 OPTIND narrowed down

stdout:
a=1 b= c= d=1 e=E
stderr:
osh12 OPTIND narrowed down

stdout:
a=1 b= c= d=1 e=E
stderr:
osh_ALT12 OPTIND narrowed down

stdout:
a=1 b= c= d=1 e=E
stderr: