Results for var-ref.test.sh

statusoshosh_.pyosh_.cc
pass 874
ok 111
N-I 111
FAIL 347
total131313
caseoshosh_.pyosh_.ccdescription
0pass pass pass var ref ${!a}
1pass pass FAIL ref to $@ with @
details
2pass pass FAIL ref to $1 and $2 with 1 and 2
details
3FAIL FAIL FAIL var ref with 1 and @ and *
detailsdetailsdetails
4pass pass pass var ref to special var BASH_SOURCE
5N-I N-I N-I var ref to $? with '?' (not in Oil)
detailsdetailsdetails
6FAIL FAIL FAIL indirection, *then* fancy expansion features
detailsdetailsdetails
7FAIL FAIL FAIL indirection *to* an array reference
detailsdetailsdetails
8pass FAIL FAIL indirection to nasty complex array references
detailsdetails
9pass pass pass indirection *to* fancy expansion features bash disallows
10ok ok ok Bad var ref with ${!a}
detailsdetailsdetails
11pass pass FAIL ${!OPTIND} (used by bash completion
details
12pass pass pass ${!ref-default}
19 passed, 3 OK, 3 not implemented, 0 BUG, 14 failed, 0 timeouts, 0 cases skipped
3 failed under osh

Details on runs that didn't PASS

osh_.cc1 ref to $@ with @

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

stdout:
stderr: 
set 4
  echo ref=${!ref}
  ^~~~
[ stdin ]:3: fatal: Bad indirect expansion: '@'
osh_.cc2 ref to $1 and $2 with 1 and 2

[osh_.cc stdout] Expected 'ref1=one\nref2=two\n', got 'ref1=\nref2=\n'

stdout:
ref1=
ref2=
stderr:
set 4
osh3 var ref with 1 and @ and *

[osh stdout] Expected '|x|\n|x|y|\n|x y|\n', got '|x|\n|x|y|\n|x|y|\n'

stdout:
|x|
|x|y|
|x|y|
stderr:
osh_.py3 var ref with 1 and @ and *

[osh_.py stdout] Expected '|x|\n|x|y|\n|x y|\n', got '|x|\n|x|y|\n|x|y|\n'

stdout:
|x|
|x|y|
|x|y|
stderr:
osh_.cc3 var ref with 1 and @ and *

[osh_.cc stdout] Expected '|x|\n|x|y|\n|x y|\n', got '||\n'
[osh_.cc status] Expected 0, got 1

stdout:
||
stderr:
set 4
  ref=@; printf "|%s" "${!ref}" $'\n'
         ^~~~~~
TODO:3: fatal: Bad indirect expansion: '@'
osh5 var ref to $? with '?' (not in Oil)

stdout:
myfunc
stderr:
    echo ${!ref}
            ^~~
[ stdin ]:3: fatal: Bad indirect expansion: '?'
osh_.py5 var ref to $? with '?' (not in Oil)

stdout:
myfunc
stderr:
    echo ${!ref}
            ^~~
[ stdin ]:3: fatal: Bad indirect expansion: '?'
osh_.cc5 var ref to $? with '?' (not in Oil)

stdout:
myfunc
stderr:
    echo ${!ref}
    ^~~~
[ stdin ]:3: fatal: Bad indirect expansion: '?'
osh6 indirection, *then* fancy expansion features

[osh stdout] Expected 'ok\n', got "${!b[1]} -> expected asdf, got asdf x\n$zz -> expected foo, got \nbar vs foo\n$zz -> expected foo, got \nbad err msg: ${!w:?oops} -> ${!w:?oops}\n ^\n[ eval at line 10 of (source.Stdin comment:'') ]:10: fatal: unset variable 'oops'\n${!x^a} -> expected Aaabcc, got \n${!p@P} -> expected $ , got p pp\nok\n"

stdout:
${!b[1]} -> expected asdf, got asdf x
$zz -> expected foo, got 
bar vs foo
$zz -> expected foo, got 
bad err msg: ${!w:?oops} ->   ${!w:?oops}
     ^
[ eval at line 10 of (source.Stdin comment:'') ]:10: fatal: unset variable 'oops'
${!x^a} -> expected Aaabcc, got 
${!p@P} -> expected $ , got p pp
ok
stderr:
  echo "${!x^a}"
  ^~~~
[ eval at line 5 of (source.Stdin comment:'') ]:5: fatal: Id.VOp1_Caret can't have an argument
osh_.py6 indirection, *then* fancy expansion features

[osh_.py stdout] Expected 'ok\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 383, in RunSimpleCommand
    status = self.cmd_ev.RunProc(func_node, argv[1:])
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1539, in RunProc
    status = self._Execute(func_node.body)
  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 968, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1364, in _ExecuteList
    status = self._Execute(child)
  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 981, in _Dispatch
    status = self._Execute(left)
  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_.cc6 indirection, *then* fancy expansion features

[osh_.cc stdout] Expected 'ok\n', got 'bad success: ${!!xd}\nbad success: ${!!x*}\nbad success: ${!!a[*]}\nbad success: ${!#x}\nbad success: ${!#a[@]}\n${!a[1]} -> expected xx, got \n${!b[1]} -> expected asdf, got \n${!y:-foo} -> expected foo, got \n${!x:-foo} -> expected aaabcc, got \n$zz -> expected foo, got \nbar vs foo\n$zz -> expected foo, got \nbad success: ${!w:?oops}\nbad err msg: ${!w:?oops} -> \n${!x:?oops} -> expected aaabcc, got \n${!x:+foo} -> expected foo, got \n${!x:2} -> expected abcc, got \n${!x:2:2} -> expected ab, got \n${!x#*a} -> expected aabcc, got \n${!x%%c*} -> expected aaab, got \n${!x/a*b/d} -> expected dcc, got \n${!x^a} -> expected Aaabcc, got \n${!p@P} -> expected $ , got \nok\n'

stdout:
bad success: ${!!xd}
bad success: ${!!x*}
bad success: ${!!a[*]}
bad success: ${!#x}
bad success: ${!#a[@]}
${!a[1]} -> expected xx, got 
${!b[1]} -> expected asdf, got 
${!y:-foo} -> expected foo, got 
${!x:-foo} -> expected aaabcc, got 
$zz -> expected foo, got 
bar vs foo
$zz -> expected foo, got 
bad success: ${!w:?oops}
bad err msg: ${!w:?oops} -> 
${!x:?oops} -> expected aaabcc, got 
${!x:+foo} -> expected foo, got 
${!x:2} -> expected abcc, got 
${!x:2:2} -> expected ab, got 
${!x#*a} -> expected aabcc, got 
${!x%%c*} -> expected aaab, got 
${!x/a*b/d} -> expected dcc, got 
${!x^a} -> expected Aaabcc, got 
${!p@P} -> expected $ , got 
ok
stderr:
osh7 indirection *to* an array reference

[osh stdout] Expected '.\n.x\n.x.y\n.x y\n', got '.\n.x\n.x.y\n.x.y\n'

stdout:
.
.x
.x.y
.x.y
stderr:
osh_.py7 indirection *to* an array reference

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

stdout:
.
.x
.x.y
.x.y
stderr:
osh_.cc7 indirection *to* an array reference

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

stdout:
.
.x
stderr:
    printf ".%s" "${!1}"
    ^~~~~~
[ stdin ]:2: fatal: Bad indirect expansion: 'b[@]'
osh_.py8 indirection to nasty complex array references

[osh_.py stdout] Expected '1 end\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 383, in RunSimpleCommand
    status = self.cmd_ev.RunProc(func_node, argv[1:])
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1539, in RunProc
    status = self._Execute(func_node.body)
  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 968, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1364, in _ExecuteList
    status = self._Execute(child)
  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_.cc8 indirection to nasty complex array references

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

stdout:
end
stderr:
osh10 Bad var ref with ${!a}

stdout:
stderr: 
  echo ref ${!a}
              ^
[ stdin ]:2: fatal: Bad indirect expansion: 'bad var name'
osh_.py10 Bad var ref with ${!a}

stdout:
stderr: 
  echo ref ${!a}
              ^
[ stdin ]:2: fatal: Bad indirect expansion: 'bad var name'
osh_.cc10 Bad var ref with ${!a}

stdout:
stderr: 
  echo ref ${!a}
  ^~~~
[ stdin ]:2: fatal: Bad indirect expansion: 'bad var name'
osh_.cc11 ${!OPTIND} (used by bash completion

[osh_.cc stdout] Expected 'a\nx\ny\n', got '\nx\ny\n'

stdout:
x
y
stderr:
set 5