sh-options () { run-file sh-options "$@" } run-file () { local spec_name=$1; shift; sh-spec spec/$spec_name.test.sh --compare-shells --oils-bin-dir $PWD/bin "$@" }
spec test index / oilshell.org
114 passed, 22 OK, 42 not implemented, 3 BUG, 3 failed, 0 timeouts, 0 cases skipped 3 failed under osh
bash | 0 $- with -c stdout: huBcstderr: |
mksh | 0 $- with -c stdout: uhcstderr: |
bash | 1 $- with pipefail stdout: huBsstderr: |
dash | 1 $- with pipefail stdout: stderr: dash: 1: set: Illegal option -o pipefail |
mksh | 1 $- with pipefail stdout: ushstderr: |
dash | 2 $- and more options stdout: stderr: dash: 3: [[: not found |
dash | 6 pass shopt options like sh -O nullglob stdout: stderr: dash: 0: Illegal option -O dash: 0: Illegal option -O |
mksh | 6 pass shopt options like sh -O nullglob stdout: stderr: mksh: mksh: -O: unknown option mksh: mksh: -O: unknown option |
dash | 7 can continue after unknown option stdout: stderr: dash: 2: set: Illegal option -o STRICT |
mksh | 7 can continue after unknown option stdout: stderr: mksh: <stdin>[2]: set: STRICT: bad option |
dash | 10 vi and emacs are mutually exclusive stdout: ___ ___ ___stderr: dash: 2: shopt: not found dash: 2: shopt: not found dash: 2: shopt: not found |
mksh | 10 vi and emacs are mutually exclusive stdout: ___ ___ ___stderr: mksh: <stdin>[5]: shopt: not found mksh: <stdin>[8]: shopt: not found mksh: <stdin>[11]: shopt: not found |
dash | 11 interactive shell starts with emacs mode on stdout: stderr: |
mksh | 11 interactive shell starts with emacs mode on stdout: non-interactive 0 1 interactive 0 1stderr: mksh: can't find tty fd: No such device or address mksh: warning: won't have full job control |
dash | 12 nounset stdout: []stderr: dash: 3: unset: parameter not set |
dash | 13 -u is nounset stdout: []stderr: dash: 3: unset: parameter not set |
dash | 19 set -eu (flag parsing) stdout: stderr: dash: 2: unset: parameter not set |
osh | 20 -n for no execution (useful with --ast-output) [osh stdout] Expected '1\n', got '1\n2\n3\n' stdout: 1 2 3stderr: |
dash | 21 pipefail stdout: 0stderr: dash: 3: set: Illegal option -o pipefail |
dash | 22 shopt -p -o prints 'set' options stdout: stderr: |
mksh | 22 shopt -p -o prints 'set' options stdout: stderr: |
dash | 23 shopt -o prints 'set' options stdout: stderr: |
mksh | 23 shopt -o prints 'set' options stdout: stderr: |
dash | 24 shopt -p prints 'shopt' options stdout: stderr: dash: 1: shopt: not found dash: 2: shopt: not found dash: 3: shopt: not found |
mksh | 24 shopt -p prints 'shopt' options stdout: stderr: mksh: <stdin>[1]: shopt: not found mksh: <stdin>[2]: shopt: not found mksh: <stdin>[3]: shopt: not found |
dash | 25 shopt with no flags prints options stdout: 0 one.txt 0stderr: dash: 3: shopt: not found dash: 8: shopt: not found |
mksh | 25 shopt with no flags prints options stdout: 0 one.txt 0stderr: mksh: <stdin>[3]: shopt: not found mksh: <stdin>[8]: shopt: not found |
dash | 27 noclobber on stdout: 0 2stderr: rm: cannot remove '/home/uke/oil/_tmp/spec-tmp/sh-options.test.sh.21666/27-dash/no-clobber': No such file or directory dash: 5: cannot create /home/uke/oil/_tmp/spec-tmp/sh-options.test.sh.21666/27-dash/no-clobber: File exists |
osh | 27 noclobber on [osh stdout] Expected u'0\n1\n', got '0\n0\n' stdout: 0 0stderr: rm: cannot remove '/home/uke/oil/_tmp/spec-tmp/sh-options.test.sh.21666/27-osh/no-clobber': No such file or directory |
dash | 28 SHELLOPTS is updated when options are changed stdout: 1 1 1stderr: + echo + grep -q xtrace + echo 1 + set +x |
mksh | 28 SHELLOPTS is updated when options are changed stdout: 1 1 1stderr: + echo + grep -q xtrace + echo 1 + set +x |
dash | 29 SHELLOPTS is readonly stdout: status=0stderr: |
mksh | 29 SHELLOPTS is readonly stdout: status=0stderr: |
osh | 29 SHELLOPTS is readonly stdout: stderr: SHELLOPTS=x ^~~~~~~~~~ [ stdin ]:1: fatal: Can't assign to readonly value 'SHELLOPTS' |
dash | 30 SHELLOPTS and BASHOPTS are set stdout: stderr: dash: 1: SHELLOPTS: parameter not set or null |
mksh | 30 SHELLOPTS and BASHOPTS are set stdout: stderr: mksh: <stdin>[1]: SHELLOPTS: parameter null or not set |
osh | 30 SHELLOPTS and BASHOPTS are set [osh status] Expected 0, got 1 stdout: stderr: echo shellopts ${SHELLOPTS:?} > /dev/null ^~~~~~~~~ [ stdin ]:1: fatal: Var SHELLOPTS is empty |
mksh | 31 set - - stdout: a b a b a b - + - --stderr: |
osh | 31 set - - stdout: a b - a b a b - - - + + - --stderr: |
dash | 33 set without args lists variables stdout: __GLOBAL='mutated' __OTHERLOCAL='L' __mylocal='L' __var_in_parent_scope='D'stderr: |
mksh | 33 set without args lists variables stdout: __GLOBAL=mutated __var_in_parent_scope=D __OTHERLOCAL=L __mylocal=Lstderr: |
dash | 35 set without args and array variables (not in OSH) stdout: stderr: dash: 1: declare: not found dash: 2: Syntax error: "(" unexpected |
mksh | 35 set without args and array variables (not in OSH) stdout: __array[0]=1 __array[1]=2 __array[2]='3 4'stderr: mksh: <stdin>[1]: declare: not found |
osh | 35 set without args and array variables (not in OSH) stdout: stderr: |
dash | 36 set without args and assoc array variables (not in OSH) stdout: stderr: dash: 1: typeset: not found dash: 2: __assoc[k e y]=v a l: not found dash: 3: __assoc[a]=b: not found |
mksh | 36 set without args and assoc array variables (not in OSH) stdout: stderr: mksh: <stdin>[1]: typeset: -A: unknown option mksh: <stdin>[2]: 'k e y': multi-character character constant |
osh | 36 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) |
dash | 37 shopt -q stdout: nullglob=127 nullglob=127 nullglob,failglob=127 nullglob,failglob=127stderr: dash: 1: shopt: not found dash: 4: shopt: not found dash: 6: shopt: not found dash: 9: shopt: not found dash: 12: shopt: not found dash: 13: shopt: not found |
mksh | 37 shopt -q stdout: nullglob=127 nullglob=127 nullglob,failglob=127 nullglob,failglob=127stderr: mksh: <stdin>[1]: shopt: not found mksh: <stdin>[4]: shopt: not found mksh: <stdin>[6]: shopt: not found mksh: <stdin>[9]: shopt: not found mksh: <stdin>[12]: shopt: not found mksh: <stdin>[13]: shopt: not found |
bash | 38 shopt -q invalid stdout: invalidZZ=1stderr: bash: line 1: shopt: invalidZZ: invalid shell option name |
dash | 38 shopt -q invalid stdout: invalidZZ=127stderr: dash: 1: shopt: not found |
mksh | 38 shopt -q invalid stdout: invalidZZ=127stderr: mksh: <stdin>[1]: shopt: not found |
bash | 39 shopt -s strict:all stdout: - - -stderr: bash: line 9: shopt: strict:all: invalid shell option name bash: line 11: shopt: strict_arith: invalid shell option name |
dash | 39 shopt -s strict:all stdout: stderr: dash: 3: Syntax error: Bad function name |
mksh | 39 shopt -s strict:all stdout: - - -stderr: mksh: <stdin>[8]: shopt: not found mksh: <stdin>[9]: shopt: not found mksh: <stdin>[10]: shopt: not found mksh: <stdin>[11]: shopt: not found mksh: <stdin>[12]: shopt: not found |
dash | 40 shopt allows for backward compatibility like bash stdout: status=0stderr: dash: 3: shopt: not found dash: 8: shopt: not found |
mksh | 40 shopt allows for backward compatibility like bash stdout: status=0stderr: mksh: <stdin>[3]: shopt: not found mksh: <stdin>[8]: shopt: not found |
bash | 41 shopt -p validates option names stdout: shopt -u nullglob shopt -u failglob status=1 nullglob off failglob off status=1stderr: bash: line 1: shopt: invalid: invalid shell option name bash: line 3: shopt: invalid: invalid shell option name |
dash | 41 shopt -p validates option names stdout: status=127 status=127stderr: dash: 1: shopt: not found dash: 3: shopt: not found |
mksh | 41 shopt -p validates option names stdout: status=127 status=127stderr: mksh: <stdin>[1]: shopt: not found mksh: <stdin>[3]: shopt: not found |
bash | 42 shopt -p -o validates option names stdout: set +o errexit set +o nounset status=1stderr: bash: line 1: shopt: invalid: invalid option name |
dash | 42 shopt -p -o validates option names stdout: status=127stderr: dash: 1: shopt: not found |
mksh | 42 shopt -p -o validates option names stdout: status=127stderr: mksh: <stdin>[1]: shopt: not found |
bash | 43 stubbed out bash options stdout: 1 0 0 0stderr: bash: line 2: shopt: foo: invalid shell option name |
dash | 43 stubbed out bash options stdout: 127 127 127 127stderr: dash: 2: shopt: not found dash: 2: shopt: not found dash: 2: shopt: not found dash: 2: shopt: not found |
mksh | 43 stubbed out bash options stdout: 127 127 127 127stderr: mksh: <stdin>[4]: shopt: not found mksh: <stdin>[4]: shopt: not found mksh: <stdin>[4]: shopt: not found mksh: <stdin>[4]: shopt: not found |
bash | 44 shopt -s nounset works in Oil, not in bash stdout: status=1 nounset offstderr: bash: line 7: shopt: nounset: invalid shell option name |
dash | 44 shopt -s nounset works in Oil, not in bash stdout: N-Istderr: |
mksh | 44 shopt -s nounset works in Oil, not in bash stdout: N-Istderr: |
bash | 45 no-ops not in shopt -p output stdout: shopt -u xpg_echo --stderr: |