/home/uke/oil/bin/osh interactive: spec test case results

Results for interactive.test.sh

statusosh
pass 18
total18
caseoshdescription
0pass 'exit' in oshrc (regression)
1pass fatal errors continue
2pass interactive shell loads rcfile (when combined with -c)
3pass --rcfile with parse error - shell is executed anyway
4pass interactive shell loads files in rcdir (when combined with -c)
5pass nonexistent --rcdir is ignored
6pass shell doesn't load rcfile/rcdir if --norc is given
7pass interactive shell runs PROMPT_COMMAND after each command
8pass parse error in PROMPT_COMMAND
9pass runtime error in PROMPT_COMMAND
10pass Error message with bad oshrc file (currently ignored)
11pass PROMPT_COMMAND can see $?, like bash
12pass PROMPT_COMMAND that writes to BASH_REMATCH
13pass NO ASSERTIONS: Are startup files sourced before or after job control?
14pass HISTFILE is written in interactive shell
15pass HISTFILE default value
16pass HISTFILE=my-history loads history from that file, and writes back to it
17pass HISTFILE=my-history with history -a
18 passed, 0 OK, 0 not implemented, 0 BUG, 0 failed, 0 timeouts, 0 cases skipped

Details on runs that didn't PASS

osh0 'exit' in oshrc (regression)

stdout:
one
stderr:
osh1 fatal errors continue

stdout:
one
stderr:
  echo $(( 1 / 0 ))
             ^
[ -c flag ]:2: fatal: Divide by zero
osh2 interactive shell loads rcfile (when combined with -c)

stdout:
1
RCFILE
2
stderr:
osh3 --rcfile with parse error - shell is executed anyway

stdout:
flag -c
status=0
stderr:
  echo RCFILE; ( echo
                      ^
/home/uke/oil/_tmp/spec-tmp/interactive.test.sh/03-osh/rcfile:1: Expected word type Id.Right_Subshell, got Id.Eof_Real
osh4 interactive shell loads files in rcdir (when combined with -c)

stdout:
A
rcdir 1
rcdir 2
B
rcfile first
rcdir 1
rcdir 2
C
stderr:
osh5 nonexistent --rcdir is ignored

stdout:
hi
status=0
stderr:
osh6 shell doesn't load rcfile/rcdir if --norc is given

stdout:
A
C
D
stderr:
osh warning: --rcfile ignored in non-interactive shell
osh warning: --rcfile ignored in non-interactive shell
osh warning: --rcdir ignored in non-interactive shell
osh7 interactive shell runs PROMPT_COMMAND after each command

stdout:
PROMPT
one
PROMPT
two
PROMPT
^D
stderr:
osh8 parse error in PROMPT_COMMAND

stdout:
one
two
^D
stderr:
  ;
  ^
[ var 'PROMPT_COMMAND' at ? ]:1: Invalid word while parsing command
  ;
  ^
[ var 'PROMPT_COMMAND' at ? ]:1: Invalid word while parsing command
  ;
  ^
[ var 'PROMPT_COMMAND' at ? ]:1: Invalid word while parsing command
osh9 runtime error in PROMPT_COMMAND

stdout:
one
two
^D
stderr:
  echo PROMPT $(( 1 / 0 ))
                    ^
[ var 'PROMPT_COMMAND' at ? ]:1: fatal: Divide by zero
  echo PROMPT $(( 1 / 0 ))
                    ^
[ var 'PROMPT_COMMAND' at ? ]:1: fatal: Divide by zero
  echo PROMPT $(( 1 / 0 ))
                    ^
[ var 'PROMPT_COMMAND' at ? ]:1: fatal: Divide by zero
osh10 Error message with bad oshrc file (currently ignored)

stdout:
hi
status=0
bad_oshrc:
stderr:
osh11 PROMPT_COMMAND can see $?, like bash

stdout:
last_status=0
last_status=42
last_status=43
ok
last_status=0
^D
stderr:
osh12 PROMPT_COMMAND that writes to BASH_REMATCH

stdout:
---
one
---
---
bar b a r
---
^D
stderr:
osh13 NO ASSERTIONS: Are startup files sourced before or after job control?

stdout:
myrc: pid = 896
    PID    PPID    PGID     SID   TPGID COMMAND
    896     893     690       1       1 python2
main: pid = 896
    PID    PPID    PGID     SID   TPGID COMMAND
    896     893     896       1     900 python2
stderr:
osh14 HISTFILE is written in interactive shell

stdout:
hist1
hist2
^D
echo hist1; echo hist2
stderr:
osh-0.32$ osh-0.32$ 
osh15 HISTFILE default value

stdout:
status=0
stderr:
osh16 HISTFILE=my-history loads history from that file, and writes back to it

stdout:
2
    1  echo 1
    2  echo 2
    3  history

-- after shell exit --
echo 1
echo 2
history
stderr:
osh-0.32$ osh-0.32$ osh-0.32$ 
osh17 HISTFILE=my-history with history -a

stdout:
2

-- after shell exit --
echo 1
history -a
echo 2
stderr:
osh-0.32$ osh-0.32$ osh-0.32$