Results for special-vars.test.sh

statusoshosh_.pyosh_.cc
pass 24218
FAIL 6922
total303030
caseoshosh_.pyosh_.ccdescription
0pass pass FAIL $PWD is set
details
1pass pass FAIL $PWD is not only set, but exported
details
2pass pass FAIL $HOME is NOT set
details
3pass FAIL FAIL $1 .. $9 are scoped, while $0 is not
detailsdetails
4pass pass pass $?
5pass pass pass $#
6FAIL FAIL FAIL $_
detailsdetailsdetails
7pass pass FAIL $$ looks like a PID
details
8pass pass FAIL $$ doesn't change with subshell or command sub
details
9pass pass FAIL $BASHPID DOES change with subshell and command sub
details
10pass FAIL FAIL Background PID $! looks like a PID
detailsdetails
11pass pass FAIL $PPID
details
12pass pass FAIL $PIPESTATUS
details
13FAIL FAIL FAIL $RANDOM
detailsdetailsdetails
14pass pass FAIL $UID and $EUID
details
15pass pass pass $OSTYPE is non-empty
16pass pass FAIL $HOSTNAME
details
17pass pass FAIL $LINENO is the current line, not line of function call
details
18pass pass FAIL $LINENO in "bare" redirect arg (bug regression)
details
19pass pass FAIL $LINENO in redirect arg (bug regression)
details
20pass pass pass $LINENO for [[
21pass pass pass $LINENO for ((
22pass pass pass $LINENO in for loop
23pass pass pass $LINENO in other for loops
24FAIL FAIL FAIL $LINENO in for (( loop
detailsdetailsdetails
25pass pass pass $LINENO for assignment
26FAIL FAIL FAIL $_
detailsdetailsdetails
27FAIL FAIL FAIL $_ with assignments, arrays, etc.
detailsdetailsdetails
28FAIL FAIL FAIL $_ undefined
detailsdetailsdetails
29pass FAIL FAIL BASH_VERSION / OIL_VERSION
detailsdetails
53 passed, 0 OK, 0 not implemented, 0 BUG, 37 failed, 0 timeouts, 0 cases skipped
6 failed under osh

Details on runs that didn't PASS

osh_.cc0 $PWD is set

[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc1 $PWD is not only set, but exported

[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc2 $HOME is NOT set

[osh_.cc stdout] Expected 'status=0\nstatus=1\nstatus=1\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.py3 $1 .. $9 are scoped, while $0 is not

[osh_.py stdout] Expected 'sh a b\n', got 'sh_eval.py a b\n'

stdout:
sh_eval.py a b
stderr:
osh_.cc3 $1 .. $9 are scoped, while $0 is not

[osh_.cc stdout] Expected 'sh a b\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh6 $_

[osh stdout] Expected u'hi\nhi\n', got 'hi\n\n'

stdout:
hi

stderr:
osh_.py6 $_

[osh_.py stdout] Expected u'hi\nhi\n', got 'hi\n\n'

stdout:
hi

stderr:
osh_.cc6 $_

[osh_.cc stdout] Expected u'hi\nhi\n', got 'hi\n\n'

stdout:
hi

stderr:
dumb_alloc:
	gNumNew = 1809
	gNumDelete = 126
	gMemPos = 62416

	gNumMalloc = 79
	gNumFree = 0
	gMemPos2 = 10464
osh_.cc7 $$ looks like a PID

[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc8 $$ doesn't change with subshell or command sub

[osh_.cc stdout] Expected 'subshell OK\ncommand sub OK\n', got 'subshell OK\n'
[osh_.cc status] Expected 3, got -6

stdout:
subshell OK
stderr:
osh_eval.opt: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc9 $BASHPID DOES change with subshell and command sub

[osh_.cc stdout] Expected 'subshell OK\ncommand sub OK\n', got 'subshell OK\n'
[osh_.cc status] Expected 3, got -6

stdout:
subshell OK
stderr:
osh_eval.opt: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.py10 Background PID $! looks like a PID

[osh_.py stdout] Expected 'status=0\n', got ''
[osh_.py status] Expected 0, got 1
[osh_.py stderr] Found 'Traceback (most recent'

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/travis/build/oilshell/oil/bin/osh_eval.py", line 68, in <module>
    sys.exit(main(sys.argv))
  File "/home/travis/build/oilshell/oil/bin/osh_eval.py", line 36, in main
    None)
  File "/home/travis/build/oilshell/oil/core/shell_native.py", line 476, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/travis/build/oilshell/oil/core/main_loop.py", line 324, in Batch
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags=cmd_flags)
  File "/home/travis/build/oilshell/oil/osh/cmd_eval.py", line 1498, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/travis/build/oilshell/oil/osh/cmd_eval.py", line 1345, in _Execute
    status, check_errexit = self._Dispatch(node, pipeline_st)
  File "/home/travis/build/oilshell/oil/osh/cmd_eval.py", line 623, in _Dispatch
    status = self._RunSimpleCommand(cmd_val, node.do_fork)
  File "/home/travis/build/oilshell/oil/osh/cmd_eval.py", line 477, in _RunSimpleCommand
    return self.shell_ex.RunSimpleCommand(cmd_val, do_fork)
  File "/home/travis/build/oilshell/oil/core/executor.py", line 230, in RunSimpleCommand
    return self.RunBuiltin(builtin_id, cmd_val)
  File "/home/travis/build/oilshell/oil/core/executor.py", line 121, in RunBuiltin
    builtin_func = self.builtins[builtin_id]
KeyError: 33
osh_.cc10 Background PID $! looks like a PID

[osh_.cc stdout] Expected 'status=0\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.opt: mycpp/mylib.h:674: V Dict<K, V>::index(K) [with K = int; V = vm::_Builtin*]: Assertion `0' failed.
osh_.cc11 $PPID

[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc12 $PIPESTATUS

[osh_.cc stdout] Expected "['0', '33', '0']\n", got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh13 $RANDOM

[osh status] Expected 0, got 1

stdout:
0
stderr:
osh_.py13 $RANDOM

[osh_.py status] Expected 0, got 1

stdout:
0
stderr:
osh_.cc13 $RANDOM

[osh_.cc status] Expected 0, got -6

stdout:
0
stderr:
osh_eval.opt: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc14 $UID and $EUID

[osh_.cc stdout] Expected 'status=0\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc16 $HOSTNAME

[osh_.cc stdout] Expected 'status=0\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc17 $LINENO is the current line, not line of function call

[osh_.cc stdout] Expected "1\n['6']\n['3']\n['8']\n", got "['6']\n['3']\n['8']\n1\n"

stdout:
['6']
['3']
['8']
1
stderr:
dumb_alloc:
	gNumNew = 2246
	gNumDelete = 197
	gMemPos = 75616

	gNumMalloc = 204
	gNumFree = 0
	gMemPos2 = 12464
osh_.cc18 $LINENO in "bare" redirect arg (bug regression)

[osh_.cc stdout] Expected 'written\n5\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:143: void posix::dup2(int, int): Assertion `0' failed.
osh_.cc19 $LINENO in redirect arg (bug regression)

[osh_.cc stdout] Expected 'written\n5\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:143: void posix::dup2(int, int): Assertion `0' failed.
osh24 $LINENO in for (( loop

[osh stdout] Expected 'one\n0\n1\n', got 'one\n0\n1\n2\n'

stdout:
one
0
1
2
stderr:
osh_.py24 $LINENO in for (( loop

[osh_.py stdout] Expected 'one\n0\n1\n', got 'one\n0\n1\n2\n'

stdout:
one
0
1
2
stderr:
osh_.cc24 $LINENO in for (( loop

[osh_.cc stdout] Expected 'one\n0\n1\n', got 'one\n0\n1\n2\n'

stdout:
one
0
1
2
stderr:
dumb_alloc:
	gNumNew = 2107
	gNumDelete = 157
	gMemPos = 70912

	gNumMalloc = 167
	gNumFree = 0
	gMemPos2 = 11872
osh26 $_

[osh stdout] Expected '1\nfoobar\n', got '\n\n'

stdout:

stderr:
osh_.py26 $_

[osh_.py stdout] Expected '1\nfoobar\n', got '\n\n'

stdout:

stderr:
osh_.cc26 $_

[osh_.cc stdout] Expected '1\nfoobar\n', got '\n\n'

stdout:

stderr:
dumb_alloc:
	gNumNew = 1937
	gNumDelete = 152
	gMemPos = 65472

	gNumMalloc = 105
	gNumFree = 0
	gMemPos2 = 10880
osh27 $_ with assignments, arrays, etc.

[osh stdout] Expected 'foo\ns:\ns:s=bar\na:\na:a\nflag:a\n', got '\ns:\ns:\na:\na:\nflag:\n'

stdout:
s:
s:
a:
a:
flag:
stderr:
osh_.py27 $_ with assignments, arrays, etc.

[osh_.py stdout] Expected 'foo\ns:\ns:s=bar\na:\na:a\nflag:a\n', got '\ns:\ns:\na:\na:\nflag:\n'

stdout:
s:
s:
a:
a:
flag:
stderr:
osh_.cc27 $_ with assignments, arrays, etc.

[osh_.cc stdout] Expected 'foo\ns:\ns:s=bar\na:\na:a\nflag:a\n', got '\ns:\ns:\na:\na:\nflag:\n'

stdout:
s:
s:
a:
a:
flag:
stderr:
dumb_alloc:
	gNumNew = 3062
	gNumDelete = 364
	gMemPos = 98208

	gNumMalloc = 354
	gNumFree = 0
	gMemPos2 = 14912
osh28 $_ undefined

[osh stdout] Expected 'nonempty=0\n', got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
  echo $_
       ^~
[ -c flag ]:1: fatal: Undefined variable '_'
  x=$($SH -u -c 'echo $_')
  ^~
[ stdin ]:3: fatal: Exiting with status 1 (assignment in PID 30738)
osh_.py28 $_ undefined

[osh_.py stdout] Expected 'nonempty=0\n', got ''
[osh_.py status] Expected 0, got 1

stdout:
stderr: 
  echo $_
       ^~
[ -c flag ]:1: fatal: Undefined variable '_'
  x=$($SH -u -c 'echo $_')
  ^~
[ stdin ]:3: fatal: Exiting with status 1 (assignment in PID 30746)
osh_.cc28 $_ undefined

[osh_.cc stdout] Expected 'nonempty=0\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.py29 BASH_VERSION / OIL_VERSION

[osh_.py stdout] Expected 'matched=0\n', got 'no version\n'

stdout:
no version
stderr:
osh_.cc29 BASH_VERSION / OIL_VERSION

[osh_.cc stdout] Expected 'matched=0\n', got 'no version\n'

stdout:
no version
stderr:
dumb_alloc:
	gNumNew = 2020
	gNumDelete = 190
	gMemPos = 69120

	gNumMalloc = 98
	gNumFree = 0
	gMemPos2 = 10816