/home/uke/oil/bin/osh
spec test index / oilshell.org
44 passed, 2 OK, 2 not implemented, 0 BUG, 2 failed, 0 timeouts, 0 cases skipped 2 failed under osh
osh | 0 $- with -c stdout: ustderr: |
osh | 1 $- with pipefail stdout: ustderr: |
osh | 2 $- and more options stdout: yes yes yes yesstderr: |
osh | 3 $- with interactive shell stdout: FALSE TRUEstderr: |
osh | 4 pass short options like sh -e stdout: stderr: |
osh | 5 pass long options like sh -o errexit stdout: stderr: |
osh | 6 pass shopt options like sh -O nullglob stdout: foo *.nonexistent bar foo barstderr: |
osh | 7 can continue after unknown option stdout: hellostderr: set -o STRICT || true # unknown option ^~~ [ stdin ]:2: 'set' got invalid option 'STRICT' |
osh | 8 set with both options and argv stdout: a b cstderr: |
osh | 9 set -o vi/emacs stdout: 0 0stderr: |
osh | 10 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: |
osh | 11 interactive shell starts with emacs mode on stdout: non-interactive 1 1 interactive 0 1stderr: osh warning: --rcfile ignored with --norc osh warning: --rcfile ignored in non-interactive shell |
osh | 12 nounset stdout: []stderr: echo "[$unset]" ^~~~~~ [ stdin ]:3: fatal: Undefined variable 'unset' |
osh | 13 -u is nounset stdout: []stderr: echo "[$unset]" ^~~~~~ [ stdin ]:3: fatal: Undefined variable 'unset' |
osh | 14 nounset with "$@" stdout: a b cstderr: |
osh | 15 set -u -- clears argv stdout: stderr: |
osh | 16 set -u -- x y z stdout: x y zstderr: |
osh | 17 reset option with long flag stdout: []stderr: |
osh | 18 reset option with short flag stdout: []stderr: |
osh | 19 set -eu (flag parsing) stdout: stderr: echo "[$unset]" ^~~~~~ [ stdin ]:2: fatal: Undefined variable 'unset' |
osh | 20 -n for no execution (useful with --ast-output) [osh stdout] Expected '1\n', got '1\n2\n3\n' stdout: 1 2 3stderr: |
osh | 21 pipefail stdout: 0 2stderr: |
osh | 22 shopt -p -o prints 'set' options stdout: set +o nounset set -o nounset -- errexit noglob nounsetstderr: |
osh | 23 shopt -o prints 'set' options stdout: errexit noglob nounset --stderr: |
osh | 24 shopt -p prints 'shopt' options stdout: shopt -u nullglob shopt -s nullglobstderr: |
osh | 25 shopt with no flags prints options stdout: 2 one.txt nullglob failglob 1stderr: |
osh | 26 noclobber off stdout: status=0 status=0 status=0 foostderr: |
osh | 27 noclobber on stdout: create=0 overwrite=1 force=0 forcestderr: echo overwrite > no-clobber ^ [ stdin ]:7: Can't open 'no-clobber': File exists (noclobber) [ stdin ]:7: I/O error applying redirect: File exists |
osh | 28 noclobber on <> stdout: f.ostderr: |
osh | 29 SHELLOPTS is updated when options are changed stdout: 1 0 1stderr: + 992 echo ':xtrace' + grep -q xtrace + echo 0 + set '+x' |
osh | 30 SHELLOPTS is readonly stdout: stderr: SHELLOPTS=x ^~~~~~~~~~ [ stdin ]:1: fatal: Can't assign to readonly value 'SHELLOPTS' |
osh | 31 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 |
osh | 32 set - - stdout: a b - a b a b - - - + + - --stderr: |
osh | 33 set -o lists options stdout: noexecstderr: |
osh | 34 set without args lists variables stdout: __GLOBAL=mutated __OTHERLOCAL=L __mylocal=L __var_in_parent_scope=Dstderr: |
osh | 35 'set' and 'eval' round trip stdout: [ ] OK OK OK OK OKstderr: Code saved to /home/uke/oil/_tmp/spec-tmp/sh-options.test.sh.833/35-osh/vars-osh.txt |
osh | 36 set without args and array variables (not in OSH) stdout: stderr: |
osh | 37 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) |
osh | 38 shopt -q stdout: nullglob=1 nullglob=0 nullglob,failglob=1 nullglob,failglob=0stderr: |
osh | 39 shopt -q invalid stdout: invalidZZ=2stderr: |
osh | 40 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: |
osh | 41 shopt allows for backward compatibility like bash stdout: shopt -u nullglob status=0 shopt -s nullglobstderr: |
osh | 42 shopt -p validates option names stdout: status=2 status=2stderr: 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' |
osh | 43 shopt -p -o validates option names stdout: set +o errexit status=2stderr: shopt -p -o errexit invalid nounset ^~~~~ [ stdin ]:1: 'shopt' got invalid option 'invalid' |
osh | 44 stubbed out bash options stdout: 2 0 0 0stderr: shopt -s $name ^~~~~ [ stdin ]:3: 'shopt' got invalid option 'foo' |
osh | 45 shopt -s nounset works in YSH, not in bash stdout: status=0 set -o nounsetstderr: |
osh | 46 Unimplemented options - print, query, set, unset stdout: q=2 p=2 noflag=2 set=1stderr: 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' |
osh | 47 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=1stderr: |
osh | 48 shopt -p exit code (regression) stdout: status=0stderr: |
osh | 49 no-ops not shown by shopt -p stdout: --stderr: |