Results for var-ref.test.sh

statusoshosh-cpp
pass 3031
FAIL 10
total3131
caseoshosh-cppdescription
0pass pass var ref ${!a}
1pass pass ${!ref-default}
2pass pass ${!undef:-}
3pass pass comparison to ${!array[@]} keys (similar SYNTAX)
4pass pass ${!a[@]-'default'} is legal but fails with more than one element
5pass pass var ref to $@ with @
6pass pass var ref to $1 and $2 with 1 and 2
7pass pass var ref: 1, @, *
8pass pass var ref to special var BASH_SOURCE
9pass pass var ref to $? with '?'
10pass pass Var ref, then assignment with ${ := }
11pass pass Var ref, then error with ${ ? }
12FAIL pass Indirect expansion, THEN suffix operators
details
13pass pass var ref OF array var -- silent a[0] decay
14pass pass array ref
15pass pass array ref with strict_array
16pass pass var ref TO array var
17pass pass var ref TO array var, with subscripts
18pass pass var ref TO assoc array a[key]
19pass pass var ref TO array with arbitrary subscripts
20pass pass Bizarre tilde expansion in array index
21pass pass Indirect expansion TO fancy expansion features bash disallows
22pass pass Bad var ref
23pass pass Bad var ref 2
24pass pass ${!OPTIND} (used by bash completion
25pass pass var ref doesn't need cycle detection
26pass pass Var Ref Code Injection $(tee PWNED)
27pass pass ${!array_ref:-set} and ${!array_ref:=assign}
28pass pass Array indirect expansion with suffix operators
29pass pass Array indirect expansion with replacements
30pass pass Array indirect expansion with @? conversion
61 passed, 0 OK, 0 not implemented, 0 BUG, 1 failed, 0 timeouts, 0 cases skipped
1 failed under osh

Details on runs that didn't PASS

osh12 Indirect expansion, THEN suffix operators

[osh stdout] Expected 'ok\n' Got ''
[osh status] Expected 0 Got 1
[osh stderr] Found 'Traceback (most recent'

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/uke/oil/bin/oils_for_unix.py", line 263, in <module>
    sys.exit(main(sys.argv))
  File "/home/uke/oil/bin/oils_for_unix.py", line 232, in main
    return AppBundleMain(argv)
  File "/home/uke/oil/bin/oils_for_unix.py", line 198, in AppBundleMain
    bash_compat=(applet == 'bash'))
  File "/home/uke/oil/core/shell.py", line 1296, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/uke/oil/core/main_loop.py", line 336, in Batch
    was_parsed, status = Batch2(cmd_ev, c_parser, errfmt, cmd_flags=cmd_flags)
  File "/home/uke/oil/core/main_loop.py", line 375, in Batch2
    node = c_parser.ParseLogicalLine()  # can raise ParseError
  File "/home/uke/oil/osh/cmd_parse.py", line 2839, in ParseLogicalLine
    node = self._ParseCommandLine()
  File "/home/uke/oil/osh/cmd_parse.py", line 2695, in _ParseCommandLine
    child = self.ParseAndOr()
  File "/home/uke/oil/osh/cmd_parse.py", line 2619, in ParseAndOr
    return self._ParseAndOr()
  File "/home/uke/oil/osh/cmd_parse.py", line 2630, in _ParseAndOr
    child = self.ParsePipeline()
  File "/home/uke/oil/osh/cmd_parse.py", line 2578, in ParsePipeline
    child = self.ParseCommand()
  File "/home/uke/oil/osh/cmd_parse.py", line 2521, in ParseCommand
    return self.ParseFunctionDef()  # f() { echo; }  # function
  File "/home/uke/oil/osh/cmd_parse.py", line 2172, in ParseFunctionDef
    func.body = self.ParseCompoundCommand()
  File "/home/uke/oil/osh/cmd_parse.py", line 2073, in ParseCompoundCommand
    n1 = self.ParseBraceGroup()
  File "/home/uke/oil/osh/cmd_parse.py", line 1356, in ParseBraceGroup
    self._GetWord()
  File "/home/uke/oil/osh/cmd_parse.py", line 670, in _GetWord
    w = self.w_parser.ReadWord(self.next_lex_mode)
  File "/home/uke/oil/osh/word_parse.py", line 2329, in ReadWord
    w = self._ReadWord(word_mode)
  File "/home/uke/oil/osh/word_parse.py", line 2246, in _ReadWord
    return self._ReadCompoundOrRedir(lex_mode)
  File "/home/uke/oil/osh/word_parse.py", line 1894, in _ReadCompoundOrRedir
    return self._ReadCompoundOrRedir3(lex_mode, Id.Undefined_Tok, True)
  File "/home/uke/oil/osh/word_parse.py", line 1999, in _ReadCompoundOrRedir3
    part = self._ReadUnquotedLeftParts(is_triple_quoted)
  File "/home/uke/oil/osh/word_parse.py", line 962, in _ReadUnquotedLeftParts
    return self._ReadCommandSub(self.token_type, d_quoted=False)
  File "/home/uke/oil/osh/word_parse.py", line 1229, in _ReadCommandSub
    node = c_parser.ParseCommandSub()
  File "/home/uke/oil/osh/cmd_parse.py", line 2873, in ParseCommandSub
    c_list = self._ParseCommandTerm()
  File "/home/uke/oil/osh/cmd_parse.py", line 2760, in _ParseCommandTerm
    child = self.ParseAndOr()
  File "/home/uke/oil/osh/cmd_parse.py", line 2619, in ParseAndOr
    return self._ParseAndOr()
  File "/home/uke/oil/osh/cmd_parse.py", line 2630, in _ParseAndOr
    child = self.ParsePipeline()
  File "/home/uke/oil/osh/cmd_parse.py", line 2578, in ParsePipeline
    child = self.ParseCommand()
  File "/home/uke/oil/osh/cmd_parse.py", line 2554, in ParseCommand
    return self.ParseSimpleCommand()
  File "/home/uke/oil/osh/cmd_parse.py", line 1222, in ParseSimpleCommand
    redirects, words, typed_args, block = self._ScanSimpleCommand()
  File "/home/uke/oil/osh/cmd_parse.py", line 904, in _ScanSimpleCommand
    self._GetWord()
  File "/home/uke/oil/osh/cmd_parse.py", line 670, in _GetWord
    w = self.w_parser.ReadWord(self.next_lex_mode)
  File "/home/uke/oil/osh/word_parse.py", line 2329, in ReadWord
    w = self._ReadWord(word_mode)
  File "/home/uke/oil/osh/word_parse.py", line 2246, in _ReadWord
    return self._ReadCompoundOrRedir(lex_mode)
  File "/home/uke/oil/osh/word_parse.py", line 1894, in _ReadCompoundOrRedir
    return self._ReadCompoundOrRedir3(lex_mode, Id.Undefined_Tok, True)
  File "/home/uke/oil/osh/word_parse.py", line 1999, in _ReadCompoundOrRedir3
    part = self._ReadUnquotedLeftParts(is_triple_quoted)
  File "/home/uke/oil/osh/word_parse.py", line 910, in _ReadUnquotedLeftParts
    dq_part = self._ReadDoubleQuoted(self.cur_token)
  File "/home/uke/oil/osh/word_parse.py", line 1191, in _ReadDoubleQuoted
    self._ReadLikeDQ(left_token, False, parts)
  File "/home/uke/oil/osh/word_parse.py", line 1102, in _ReadLikeDQ
    part = word_part.EscapedLiteral(tok, "\"")
UnboundLocalError: local variable 'tok' referenced before assignment