Results for special-vars.test.sh

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

Details on runs that didn't PASS

osh_.py2 $HOME is NOT set

[osh_.py stdout] Expected 'status=0\nstatus=1\nstatus=1\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/andy/git/oilshell/oil/bin/osh_eval.py", line 417, in <module>
    status = main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 309, in main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 168, in Batch
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags=cmd_flags)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1461, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1341, in _Execute
    status, check_errexit = self._Dispatch(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 837, in _Dispatch
    val = self.word_ev.EvalRhsWord(pair.rhs)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1602, in EvalRhsWord
    return self.EvalWordToString(w)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1498, in EvalWordToString
    self._EvalWordPart(p, part_vals, quoted=False)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1332, in _EvalWordPart
    sv = self._EvalCommandSub(part.child, quoted) # type: part_value_t
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1959, in _EvalCommandSub
    stdout = self.shell_ex.RunCommandSub(node)
AttributeError: 'NoneType' object has no attribute 'RunCommandSub'
osh_.cc2 $HOME is NOT set

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

stdout:
status=0
status=0
status=0
stderr:
osh_.py3 $1 .. $9 are scoped, while $0 is not

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

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

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

stdout:
stderr: 
osh_.cc4 $?

[osh_.cc stdout] Expected '0\n33\n', got "0\n(cmd_value.Argv argv:[sh -c 'exit 33'] arg_spids:[7 9 11])\n0\n"

stdout:
0
(cmd_value.Argv argv:[sh -c 'exit 33'] arg_spids:[7 9 11])
0
stderr:
Unhandled SimpleCommand
osh_.cc5 $#

[osh_.cc stdout] Expected '4\n', got '0\n'

stdout:
0
stderr:
set 6
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:
osh_.py8 $$ doesn't change with subshell or command sub

[osh_.py stdout] Expected 'subshell OK\ncommand sub OK\n', got ''
[osh_.py status] Expected 3, got 1
[osh_.py stderr] Found 'Traceback (most recent'

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 417, in <module>
    status = main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 309, in main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 168, in Batch
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags=cmd_flags)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1461, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1341, in _Execute
    status, check_errexit = self._Dispatch(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 547, in _Dispatch
    cmd_val = self.word_ev.EvalWordSequence2(words, allow_assign=True)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1868, in EvalWordSequence2
    self._EvalWordToParts(w, False, part_vals)  # not double quoted
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1455, in _EvalWordToParts
    self._EvalWordPart(p, part_vals, quoted=quoted, is_subst=is_subst)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1332, in _EvalWordPart
    sv = self._EvalCommandSub(part.child, quoted) # type: part_value_t
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1959, in _EvalCommandSub
    stdout = self.shell_ex.RunCommandSub(node)
AttributeError: 'NoneType' object has no attribute 'RunCommandSub'
osh_.cc8 $$ doesn't change with subshell or command sub

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

stdout:
stderr: 
osh_.py9 $BASHPID DOES change with subshell and command sub

[osh_.py stdout] Expected 'subshell OK\ncommand sub OK\n', got ''
[osh_.py status] Expected 3, got 1
[osh_.py stderr] Found 'Traceback (most recent'

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 417, in <module>
    status = main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 309, in main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 168, in Batch
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags=cmd_flags)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1461, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1341, in _Execute
    status, check_errexit = self._Dispatch(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 547, in _Dispatch
    cmd_val = self.word_ev.EvalWordSequence2(words, allow_assign=True)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1868, in EvalWordSequence2
    self._EvalWordToParts(w, False, part_vals)  # not double quoted
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1455, in _EvalWordToParts
    self._EvalWordPart(p, part_vals, quoted=quoted, is_subst=is_subst)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1332, in _EvalWordPart
    sv = self._EvalCommandSub(part.child, quoted) # type: part_value_t
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1959, in _EvalCommandSub
    stdout = self.shell_ex.RunCommandSub(node)
AttributeError: 'NoneType' object has no attribute 'RunCommandSub'
osh_.cc9 $BASHPID DOES change with subshell and command sub

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

stdout:
stderr: 
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/andy/git/oilshell/oil/bin/osh_eval.py", line 417, in <module>
    status = main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 309, in main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 168, in Batch
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags=cmd_flags)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1461, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1341, in _Execute
    status, check_errexit = self._Dispatch(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 580, in _Dispatch
    status = self._RunSimpleCommand(cmd_val, node.do_fork)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 488, in _RunSimpleCommand
    return self.shell_ex.RunSimpleCommand(cmd_val, do_fork)
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 388, in RunSimpleCommand
    return self.RunBuiltin(builtin_id, cmd_val)
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 351, in RunBuiltin
    builtin_func = self.builtins[builtin_id]
KeyError: 32
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.dbg: mycpp/mylib.h:596: V Dict<int, vm::_Builtin *>::index(K) [K = int, V = vm::_Builtin *]: Assertion `0' failed.
osh_.py12 $PIPESTATUS

[osh_.py stdout] Expected "['0', '33', '0']\n", got '[]\n'

stdout:
[]
stderr:
osh_.cc12 $PIPESTATUS

[osh_.cc stdout] Expected "['0', '33', '0']\n", got '(cmd_value.Argv argv:[argv.py] arg_spids:[23])\n'

stdout:
(cmd_value.Argv argv:[argv.py] arg_spids:[23])
stderr:
Unhandled SimpleCommand
osh13 $RANDOM

[osh status] Expected 0, got 1

stdout:
0
stderr:
osh_.cc13 $RANDOM

[osh_.cc status] Expected 0, got 1

stdout:
(cmd_value.Argv
  argv: [expr '/home/andy/git/oilshell/oil/_bin/osh_eval.dbg' ':' '.*/osh$']
  arg_spids: [0 2 4 6]
)
stderr:
Unhandled SimpleCommand
osh_.py16 $HOSTNAME

[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/andy/git/oilshell/oil/bin/osh_eval.py", line 417, in <module>
    status = main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 309, in main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 168, in Batch
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags=cmd_flags)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1461, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1341, in _Execute
    status, check_errexit = self._Dispatch(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 547, in _Dispatch
    cmd_val = self.word_ev.EvalWordSequence2(words, allow_assign=True)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1868, in EvalWordSequence2
    self._EvalWordToParts(w, False, part_vals)  # not double quoted
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1455, in _EvalWordToParts
    self._EvalWordPart(p, part_vals, quoted=quoted, is_subst=is_subst)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1326, in _EvalWordPart
    self._EvalDoubleQuoted(part.parts, part_vals)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 821, in _EvalDoubleQuoted
    self._EvalWordPart(p, part_vals, quoted=True)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1332, in _EvalWordPart
    sv = self._EvalCommandSub(part.child, quoted) # type: part_value_t
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1959, in _EvalCommandSub
    stdout = self.shell_ex.RunCommandSub(node)
AttributeError: 'NoneType' object has no attribute 'RunCommandSub'
osh_.cc16 $HOSTNAME

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

stdout:
status=1
stderr:
osh_.py17 $LINENO is the current line, not line of function call

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

stdout:
['6']
['3']
['8']
1
stderr:
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 '1\n(cmd_value.Argv argv:[argv.py 6] arg_spids:[30 32])\n(cmd_value.Argv argv:[argv.py 3] arg_spids:[14 16])\n(cmd_value.Argv argv:[argv.py 8] arg_spids:[41 43])\n'

stdout:
1
(cmd_value.Argv argv:[argv.py 6] arg_spids:[30 32])
(cmd_value.Argv argv:[argv.py 3] arg_spids:[14 16])
(cmd_value.Argv argv:[argv.py 8] arg_spids:[41 43])
stderr:
Unhandled SimpleCommand
Unhandled SimpleCommand
Unhandled SimpleCommand
osh_.py18 $LINENO in "bare" redirect arg (bug regression)

[osh_.py stdout] Expected 'written\n5\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/andy/git/oilshell/oil/bin/osh_eval.py", line 417, in <module>
    status = main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 309, in main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 168, in Batch
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags=cmd_flags)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1461, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1333, in _Execute
    status, check_errexit = self._Dispatch(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 580, in _Dispatch
    status = self._RunSimpleCommand(cmd_val, node.do_fork)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 488, in _RunSimpleCommand
    return self.shell_ex.RunSimpleCommand(cmd_val, do_fork)
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 366, in RunSimpleCommand
    arg0 = argv[0]
IndexError: list index out of range
osh_.cc18 $LINENO in "bare" redirect arg (bug regression)

[osh_.cc stdout] Expected 'written\n5\n', got "(cmd_value.Argv argv:[rm -f '/bare3'] arg_spids:[4 6 8])\n"
[osh_.cc status] Expected 0, got -6

stdout:
(cmd_value.Argv argv:[rm -f '/bare3'] arg_spids:[4 6 8])
stderr:
Unhandled SimpleCommand
osh_eval.dbg: cpp/osh_bool_stat.h:18: bool bool_stat::DoUnaryOp(id_kind_asdl::Id_t, Str *): Assertion `0' failed.
osh_.py19 $LINENO in redirect arg (bug regression)

[osh_.py stdout] Expected 'written\n5\n', got 'x\n5\n'

stdout:
x
5
stderr:
osh_.cc19 $LINENO in redirect arg (bug regression)

[osh_.cc stdout] Expected 'written\n5\n', got "(cmd_value.Argv argv:[rm -f '/lineno_regression3'] arg_spids:[4 6 8])\nx\n"
[osh_.cc status] Expected 0, got -6

stdout:
(cmd_value.Argv argv:[rm -f '/lineno_regression3'] arg_spids:[4 6 8])
x
stderr:
Unhandled SimpleCommand
osh_eval.dbg: cpp/osh_bool_stat.h:18: bool bool_stat::DoUnaryOp(id_kind_asdl::Id_t, Str *): Assertion `0' failed.
osh_.cc23 $LINENO in other for loops

[osh_.cc stdout] Expected '3 a\n3 b\n3 c\n', got ''

stdout:
stderr: 
set 5
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:
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:
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:
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 ]:2: fatal: Exiting with status 1 (assignment in PID 1610)
osh_.py28 $_ undefined

[osh_.py stdout] Expected 'nonempty=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/andy/git/oilshell/oil/bin/osh_eval.py", line 417, in <module>
    status = main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 309, in main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 168, in Batch
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags=cmd_flags)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1461, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1341, in _Execute
    status, check_errexit = self._Dispatch(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 837, in _Dispatch
    val = self.word_ev.EvalRhsWord(pair.rhs)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1602, in EvalRhsWord
    return self.EvalWordToString(w)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1498, in EvalWordToString
    self._EvalWordPart(p, part_vals, quoted=False)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1332, in _EvalWordPart
    sv = self._EvalCommandSub(part.child, quoted) # type: part_value_t
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1959, in _EvalCommandSub
    stdout = self.shell_ex.RunCommandSub(node)
AttributeError: 'NoneType' object has no attribute 'RunCommandSub'
osh_.cc28 $_ undefined

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

stdout:
nonempty=1
stderr:
set 2
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: