Results for array.test.sh

casebashmkshoshdescription
0pass pass pass SETUP
1pass pass FAIL $a gives first element of array
details
2pass pass pass ${a[@]} and ${a[*]} give all elements of array
3pass BUG FAIL local array
detailsdetails
4pass pass FAIL Command with with word splitting in array
details
5pass ok FAIL space before ( in array initialization
detailsdetails
6pass pass FAIL empty array
details
7pass pass FAIL array with empty string
details
8pass pass FAIL Assign to array index without initialization
details
9pass pass pass Retrieve index
10pass pass FAIL Retrieve out of bounds index
details
11pass pass pass Retrieve index that is a variable
12pass pass pass Retrieve index that is a variable without $
13pass pass pass Retrieve index that is a command sub
14pass pass FAIL Retrieve all indices with !
details
15pass ok FAIL Retrieve indices for one value
detailsdetails
16pass ok FAIL Retrieve indices without []
detailsdetails
17pass pass FAIL All elements unquoted
details
18pass pass pass All elements quoted
19pass pass FAIL $*
details
20pass pass FAIL "$*"
details
21pass pass FAIL Interpolate array into array
details
22pass pass FAIL Arrays can't be copied directly
details
23pass BUG pass Exporting array doesn't do anything, not even first element
details
24pass BUG FAIL Env with array
detailsdetails
25pass pass FAIL Set element
details
26pass pass FAIL Set element with var ref
details
27pass pass FAIL Set element with array ref
details
28pass N-I FAIL Slice of array with [@]
detailsdetails
29pass N-I FAIL Negative slice
detailsdetails
30pass N-I FAIL Slice with arithmetic
detailsdetails
31pass pass pass Number of elements
32pass pass pass Iteration
33pass pass FAIL glob within array yields separate elements
details
34pass pass FAIL declare array and then append
details
35pass ok pass Array syntax in wrong place
details
36pass pass FAIL Empty array with :-
details
37pass ok FAIL Single array with :-
detailsdetails
38pass N-I FAIL Stripping a whole array
detailsdetails
39BUG ok FAIL Multiple subscripts not allowed
detailsdetailsdetails
40BUG ok FAIL Length op, index op, then transform op is not allowed
detailsdetailsdetails
41BUG BUG pass Array subscript not allowed on string
detailsdetails
42pass pass FAIL Create a "user" array out of the argv array
details

80 passed, 7 ok, 4 known unimplemented, 7 known bugs, 31 failed, 0 skipped

Details on runs that didn't PASS

osh1 $a gives first element of array

[osh stdout] Expected b'1\n', got b'1 2 3\n'

stdout:
1 2 3
stderr:
mksh3 local array

stdout:
stderr: 
/bin/mksh: <stdin>[2]: syntax error: '(' unexpected
osh3 local array

[osh stdout] Expected b"['1']\n", got b"['1', '2 3']\n"

stdout:
['1', '2 3']
stderr:
osh4 Command with with word splitting in array

[osh stdout] Expected b"['1 2', '3', '4']\n", got b"['1 2', '3 4']\n"

stdout:
['1 2', '3 4']
stderr:
mksh5 space before ( in array initialization

stdout:
1
stderr:
osh5 space before ( in array initialization

[osh status] Expected 2, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 378, in <module>
    sys.exit(main(sys.argv))
  File "bin/osh", line 368, in main
    return OshMain(main_argv)
  File "bin/osh", line 286, in OshMain
    node = c_parser.ParseWholeFile()
  File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 1552, in ParseWholeFile
    if not self._NewlineOk(): return None
  File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 181, in _NewlineOk
    if not self._Peek():
  File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 144, in _Peek
    w = self.w_parser.ReadWord(self.next_lex_mode)
  File "/home/andy/git/oil/bin/../osh/word_parse.py", line 1093, in ReadWord
    w, need_more = self._ReadWord(lex_mode)
  File "/home/andy/git/oil/bin/../osh/word_parse.py", line 1054, in _ReadWord
    w = self._ReadCompoundWord(lex_mode=lex_mode)
  File "/home/andy/git/oil/bin/../osh/word_parse.py", line 888, in _ReadCompoundWord
    part2 = self._ReadArrayLiteralPart()
  File "/home/andy/git/oil/bin/../osh/word_parse.py", line 839, in _ReadArrayLiteralPart
    assert self.cur_token.id == Id.Op_LParen, self.cur_token
AssertionError: (token id:WS_Space val:" " span_id:1)
osh6 empty array

[osh stdout] Expected b'[]\n', got b''

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 378, in <module>
    sys.exit(main(sys.argv))
  File "bin/osh", line 368, in main
    return OshMain(main_argv)
  File "bin/osh", line 327, in OshMain
    status, cflow = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 758, in Execute
    status, cflow = self.Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 663, in Execute
    raise AssertionError('Error evaluating words: %s' % err)
AssertionError: Error evaluating words: ["Can't index non-array with @", 'Error evaluating word part (DoubleQuotedPart\n  parts: [\n    (BracedVarSub\n      token: (token id:VSub_Name val:empty span_id:8)\n      bracket_op: (WholeArray op_id:Lit_At)\n      spids: [7 12]\n    )\n  ]\n  spids: [6 13]\n)', 'Error evaluating word (CompoundWord\n  parts: [\n    (DoubleQuotedPart\n      parts: [\n        (BracedVarSub\n          token: (token id:VSub_Name val:empty span_id:8)\n          bracket_op: (WholeArray op_id:Lit_At)\n          spids: [7 12]\n        )\n      ]\n      spids: [6 13]\n    )\n  ]\n)']
osh7 array with empty string

[osh stdout] Expected b"['']\n", got b''

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 378, in <module>
    sys.exit(main(sys.argv))
  File "bin/osh", line 368, in main
    return OshMain(main_argv)
  File "bin/osh", line 327, in OshMain
    status, cflow = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 758, in Execute
    status, cflow = self.Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 663, in Execute
    raise AssertionError('Error evaluating words: %s' % err)
AssertionError: Error evaluating words: ["Can't index non-array with @", 'Error evaluating word part (DoubleQuotedPart\n  parts: [\n    (BracedVarSub\n      token: (token id:VSub_Name val:empty span_id:10)\n      bracket_op: (WholeArray op_id:Lit_At)\n      spids: [9 14]\n    )\n  ]\n  spids: [8 15]\n)', 'Error evaluating word (CompoundWord\n  parts: [\n    (DoubleQuotedPart\n      parts: [\n        (BracedVarSub\n          token: (token id:VSub_Name val:empty span_id:10)\n          bracket_op: (WholeArray op_id:Lit_At)\n          spids: [9 14]\n        )\n      ]\n      spids: [8 15]\n    )\n  ]\n)']
osh8 Assign to array index without initialization

[osh stdout] Expected b"['9']\n", got b"['']\nUNDEFINED\n"

stdout:
['']
UNDEFINED
stderr:
Unexpected error in execvpe('b[2]=9', ['b[2]=9'], ...): [Errno 2] No such file or directory: b'/home/andy/bin/b[2]=9'
osh10 Retrieve out of bounds index

[osh stdout] Expected b"['']\n", got b"['']\nUNDEFINED\n"

stdout:
['']
UNDEFINED
stderr:
osh14 Retrieve all indices with !

[osh stdout] Expected b"['0', '1']\n", got b"['1', '2 3']\n"

stdout:
['1', '2 3']
stderr:
mksh15 Retrieve indices for one value

stdout:
['1']
stderr:
osh15 Retrieve indices for one value

[osh stdout] Expected b"['']\n", got b"['2 3']\n"

stdout:
['2 3']
stderr:
mksh16 Retrieve indices without []

stdout:
['a']
stderr:
osh16 Retrieve indices without []

[osh stdout] Expected b"['']\n", got b''

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 378, in <module>
    sys.exit(main(sys.argv))
  File "bin/osh", line 368, in main
    return OshMain(main_argv)
  File "bin/osh", line 327, in OshMain
    status, cflow = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 758, in Execute
    status, cflow = self.Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 663, in Execute
    raise AssertionError('Error evaluating words: %s' % err)
AssertionError: Error evaluating words: ['Array was referenced without explicit index, e.g. ${a[@]} or ${a[0]}', 'Error evaluating word part (DoubleQuotedPart\n  parts: [(BracedVarSub token:(token id:VSub_Name val:a span_id:14) prefix_op:VSub_Bang spids:[1215])]\n  spids: [11 16]\n)', 'Error evaluating word (CompoundWord\n  parts: [\n    (DoubleQuotedPart\n      parts: [\n        (BracedVarSub\n          token: (token id:VSub_Name val:a span_id:14)\n          prefix_op: VSub_Bang\n          spids: [12 15]\n        )\n      ]\n      spids: [11 16]\n    )\n  ]\n)']
osh17 All elements unquoted

[osh stdout] Expected b"['1', '2', '3']\n", got b"['1', '2 3']\n"

stdout:
['1', '2 3']
stderr:
osh19 $*

[osh stdout] Expected b"['1', '2', '3']\n", got b"['1', '2 3']\n"

stdout:
['1', '2 3']
stderr:
osh20 "$*"

[osh stdout] Expected b"['1 2 3']\n", got b"['1', '2 3']\n"

stdout:
['1', '2 3']
stderr:
osh21 Interpolate array into array

[osh stdout] Expected b"['0', '1', '2 3', '4 5']\n", got b''

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 378, in <module>
    sys.exit(main(sys.argv))
  File "bin/osh", line 368, in main
    return OshMain(main_argv)
  File "bin/osh", line 327, in OshMain
    status, cflow = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 758, in Execute
    status, cflow = self.Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 739, in Execute
    ok, val = self.ev.EvalCompoundWord(pair.rhs)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 580, in EvalCompoundWord
    ok, val = self.EvalWordPart(p, quoted=False)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 678, in EvalWordPart
    return self.EvalArrayLiteralPart(part)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 672, in EvalArrayLiteralPart
    raise AssertionError('Expected string')
AssertionError: Expected string
osh22 Arrays can't be copied directly

[osh stdout] Expected b"['x', 'y', 'z', 'x y z', 'x', 'YYY', 'z']\n", got b''

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 378, in <module>
    sys.exit(main(sys.argv))
  File "bin/osh", line 368, in main
    return OshMain(main_argv)
  File "bin/osh", line 327, in OshMain
    status, cflow = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 758, in Execute
    status, cflow = self.Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 739, in Execute
    ok, val = self.ev.EvalCompoundWord(pair.rhs)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 573, in EvalCompoundWord
    assert isinstance(word, ast.CompoundWord), "Expected CompoundWord, got %s" % word
AssertionError: Expected CompoundWord, got None
mksh23 Exporting array doesn't do anything, not even first element

stdout:
stderr: 
/bin/mksh: <stdin>[1]: syntax error: '(' unexpected
mksh24 Env with array

stdout:
stderr: 
/bin/mksh: <stdin>[1]: syntax error: '(' unexpected
osh24 Env with array

[osh stdout] Expected b'a\n(b b)\n', got b"<core.base.ParseError object at 0x7f2367841940>\nLine 1 of '<stdin>'\n A=a B=(b b) tests/printenv.py A B\n ^\n---\n<core.base.ParseError object at 0x7f236782cf60>\nLine 0 of '<unknown>'\n <token had no position info>\nNO COL\n---\n"

stdout:
<core.base.ParseError object at 0x7f2367841940>
Line 1 of '<stdin>'
  A=a B=(b b) tests/printenv.py A B
         ^
---
<core.base.ParseError object at 0x7f236782cf60>
Line 0 of '<unknown>'
  <token had no position info>
NO COL
---
stderr:
Unexpected array literal in binding: (CompoundWord
  parts: [
    (ArrayLiteralPart
      words: [
        (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:b span_id:5))])
        (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:b span_id:7))])
      ]
    )
  ]
)
Error parsing AndOr in ParseCommandTerm
osh25 Set element

[osh stdout] Expected b"['9', '2 3']\n", got b"['1', '2 3']\n"

stdout:
['1', '2 3']
stderr:
Unexpected error in execvpe('a[0]=9', ['a[0]=9'], ...): [Errno 2] No such file or directory: b'/home/andy/bin/a[0]=9'
osh26 Set element with var ref

[osh stdout] Expected b"['9', '2 3']\n", got b"['1', '2 3']\n"

stdout:
['1', '2 3']
stderr:
Unexpected error in execvpe('a[0]=9', ['a[0]=9'], ...): [Errno 2] No such file or directory: b'/home/andy/bin/a[0]=9'
osh27 Set element with array ref

[osh stdout] Expected b"['1', '9']\n", got b"['1', '2 3']\n"

stdout:
['1', '2 3']
stderr:
Unexpected error in execvpe('a[1]=9', ['a[1]=9'], ...): [Errno 2] No such file or directory: b'/home/andy/bin/a[1]=9'
mksh28 Slice of array with [@]

stdout:
stderr: 
/bin/mksh: <stdin>[2]: ${a[@]: 1:2}": bad substitution
osh28 Slice of array with [@]

[osh stdout] Expected b"['2', '3']\n", got b''

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 378, in <module>
    sys.exit(main(sys.argv))
  File "bin/osh", line 368, in main
    return OshMain(main_argv)
  File "bin/osh", line 327, in OshMain
    status, cflow = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 758, in Execute
    status, cflow = self.Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 659, in Execute
    argv = self.ev.EvalWords(node.words)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 791, in EvalWords
    ok, val = self.EvalCompoundWord(w, ifs=ifs, do_glob=do_glob)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 580, in EvalCompoundWord
    ok, val = self.EvalWordPart(p, quoted=False)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 696, in EvalWordPart
    return self.EvalDoubleQuotedPart(part)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 722, in EvalDoubleQuotedPart
    ok, val = self.EvalWordPart(p, quoted=True)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 705, in EvalWordPart
    return self.EvalVarSub(part, quoted=quoted)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 414, in EvalVarSub
    if part.suffix_op and LookupKind(part.suffix_op.op_id) == Kind.VTest:
AttributeError: 'Slice' object has no attribute 'op_id'
mksh29 Negative slice

stdout:
stderr: 
/bin/mksh: <stdin>[2]: ${a[@]: (-2):1}": bad substitution
osh29 Negative slice

[osh stdout] Expected b"['2']\n", got b''

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 378, in <module>
    sys.exit(main(sys.argv))
  File "bin/osh", line 368, in main
    return OshMain(main_argv)
  File "bin/osh", line 327, in OshMain
    status, cflow = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 758, in Execute
    status, cflow = self.Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 659, in Execute
    argv = self.ev.EvalWords(node.words)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 791, in EvalWords
    ok, val = self.EvalCompoundWord(w, ifs=ifs, do_glob=do_glob)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 580, in EvalCompoundWord
    ok, val = self.EvalWordPart(p, quoted=False)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 696, in EvalWordPart
    return self.EvalDoubleQuotedPart(part)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 722, in EvalDoubleQuotedPart
    ok, val = self.EvalWordPart(p, quoted=True)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 705, in EvalWordPart
    return self.EvalVarSub(part, quoted=quoted)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 414, in EvalVarSub
    if part.suffix_op and LookupKind(part.suffix_op.op_id) == Kind.VTest:
AttributeError: 'Slice' object has no attribute 'op_id'
mksh30 Slice with arithmetic

stdout:
stderr: 
/bin/mksh: <stdin>[3]: ${a[@]:i-4:2}": bad substitution
osh30 Slice with arithmetic

[osh stdout] Expected b"['2', '3']\n", got b''

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 378, in <module>
    sys.exit(main(sys.argv))
  File "bin/osh", line 368, in main
    return OshMain(main_argv)
  File "bin/osh", line 327, in OshMain
    status, cflow = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 758, in Execute
    status, cflow = self.Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 659, in Execute
    argv = self.ev.EvalWords(node.words)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 791, in EvalWords
    ok, val = self.EvalCompoundWord(w, ifs=ifs, do_glob=do_glob)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 580, in EvalCompoundWord
    ok, val = self.EvalWordPart(p, quoted=False)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 696, in EvalWordPart
    return self.EvalDoubleQuotedPart(part)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 722, in EvalDoubleQuotedPart
    ok, val = self.EvalWordPart(p, quoted=True)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 705, in EvalWordPart
    return self.EvalVarSub(part, quoted=quoted)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 414, in EvalVarSub
    if part.suffix_op and LookupKind(part.suffix_op.op_id) == Kind.VTest:
AttributeError: 'Slice' object has no attribute 'op_id'
osh33 glob within array yields separate elements

[osh stdout] Expected b"['_tmp/y.Y', '_tmp/yy.Y']\n", got b''

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 378, in <module>
    sys.exit(main(sys.argv))
  File "bin/osh", line 368, in main
    return OshMain(main_argv)
  File "bin/osh", line 327, in OshMain
    status, cflow = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 758, in Execute
    status, cflow = self.Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 663, in Execute
    raise AssertionError('Error evaluating words: %s' % err)
AssertionError: Error evaluating words: ["Can't index non-array with @", 'Error evaluating word part (DoubleQuotedPart\n  parts: [\n    (BracedVarSub\n      token: (token id:VSub_Name val:a span_id:17)\n      bracket_op: (WholeArray op_id:Lit_At)\n      spids: [16 21]\n    )\n  ]\n  spids: [15 22]\n)', 'Error evaluating word (CompoundWord\n  parts: [\n    (DoubleQuotedPart\n      parts: [\n        (BracedVarSub\n          token: (token id:VSub_Name val:a span_id:17)\n          bracket_op: (WholeArray op_id:Lit_At)\n          spids: [16 21]\n        )\n      ]\n      spids: [15 22]\n    )\n  ]\n)']
osh34 declare array and then append

[osh stdout] Expected b"['a', 'b', 'c']\n", got b''

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 378, in <module>
    sys.exit(main(sys.argv))
  File "bin/osh", line 368, in main
    return OshMain(main_argv)
  File "bin/osh", line 327, in OshMain
    status, cflow = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 758, in Execute
    status, cflow = self.Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 739, in Execute
    ok, val = self.ev.EvalCompoundWord(pair.rhs)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 573, in EvalCompoundWord
    assert isinstance(word, ast.CompoundWord), "Expected CompoundWord, got %s" % word
AssertionError: Expected CompoundWord, got None
mksh35 Array syntax in wrong place

stdout:
stderr: 
/bin/mksh: <stdin>[1]: syntax error: '(' unexpected
osh36 Empty array with :-

[osh stdout] Expected b"['not', 'one', 'not one']\n", got b''

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 378, in <module>
    sys.exit(main(sys.argv))
  File "bin/osh", line 368, in main
    return OshMain(main_argv)
  File "bin/osh", line 327, in OshMain
    status, cflow = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 758, in Execute
    status, cflow = self.Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 663, in Execute
    raise AssertionError('Error evaluating words: %s' % err)
AssertionError: Error evaluating words: ["Can't index non-array with @", 'Error evaluating word part (BracedVarSub\n  token: (token id:VSub_Name val:empty span_id:7)\n  bracket_op: (WholeArray op_id:Lit_At)\n  suffix_op: \n    (StringUnary\n      op_id: VTest_ColonHyphen\n      arg_word: \n        (CompoundWord\n          parts: [(LiteralPart token:(token id:Lit_Chars val:"not one" span_id:12))]\n        )\n    )\n  spids: [6 13]\n)', 'Error evaluating word (CompoundWord\n  parts: [\n    (BracedVarSub\n      token: (token id:VSub_Name val:empty span_id:7)\n      bracket_op: (WholeArray op_id:Lit_At)\n      suffix_op: \n        (StringUnary\n          op_id: VTest_ColonHyphen\n          arg_word: \n            (CompoundWord\n              parts: [(LiteralPart token:(token id:Lit_Chars val:"not one" span_id:12))]\n            )\n        )\n      spids: [6 13]\n    )\n  ]\n)']
mksh37 Single array with :-

stdout:
['none', 'none']
stderr:
osh37 Single array with :-

[osh stdout] Expected b"['none', '']\n", got b''

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 378, in <module>
    sys.exit(main(sys.argv))
  File "bin/osh", line 368, in main
    return OshMain(main_argv)
  File "bin/osh", line 327, in OshMain
    status, cflow = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 758, in Execute
    status, cflow = self.Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 663, in Execute
    raise AssertionError('Error evaluating words: %s' % err)
AssertionError: Error evaluating words: ["Can't index non-array with @", 'Error evaluating word part (BracedVarSub\n  token: (token id:VSub_Name val:single span_id:9)\n  bracket_op: (WholeArray op_id:Lit_At)\n  suffix_op: \n    (StringUnary\n      op_id: VTest_ColonHyphen\n      arg_word: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:none span_id:14))])\n    )\n  spids: [8 15]\n)', 'Error evaluating word (CompoundWord\n  parts: [\n    (BracedVarSub\n      token: (token id:VSub_Name val:single span_id:9)\n      bracket_op: (WholeArray op_id:Lit_At)\n      suffix_op: \n        (StringUnary\n          op_id: VTest_ColonHyphen\n          arg_word: \n            (CompoundWord\n              parts: [(LiteralPart token:(token id:Lit_Chars val:none span_id:14))]\n            )\n        )\n      spids: [8 15]\n    )\n  ]\n)']
mksh38 Stripping a whole array

stdout:
stderr: 
/bin/mksh: <stdin>[2]: ${files[@]%.c}: bad substitution
osh38 Stripping a whole array

[osh stdout] Expected b"['foo', 'sp', 'ace.h', 'bar', 'foo', 'sp ace.h', 'bar']\n", got b''

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 378, in <module>
    sys.exit(main(sys.argv))
  File "bin/osh", line 368, in main
    return OshMain(main_argv)
  File "bin/osh", line 327, in OshMain
    status, cflow = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 758, in Execute
    status, cflow = self.Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 659, in Execute
    argv = self.ev.EvalWords(node.words)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 791, in EvalWords
    ok, val = self.EvalCompoundWord(w, ifs=ifs, do_glob=do_glob)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 580, in EvalCompoundWord
    ok, val = self.EvalWordPart(p, quoted=False)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 705, in EvalWordPart
    return self.EvalVarSub(part, quoted=quoted)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 510, in EvalVarSub
    print(op.words)
AttributeError: 'StringUnary' object has no attribute 'words'
bash39 Multiple subscripts not allowed

stdout:
['123', '123']
stderr:
mksh39 Multiple subscripts not allowed

stdout:
stderr: 
/bin/mksh: <stdin>[2]: ${a[0][0]}": bad substitution
osh39 Multiple subscripts not allowed

[osh status] Expected 2, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 378, in <module>
    sys.exit(main(sys.argv))
  File "bin/osh", line 368, in main
    return OshMain(main_argv)
  File "bin/osh", line 286, in OshMain
    node = c_parser.ParseWholeFile()
  File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 1561, in ParseWholeFile
    node = self.ParseCommandTerm()
  File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 1469, in ParseCommandTerm
    child = self.ParseAndOr()
  File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 1334, in ParseAndOr
    left = self.ParsePipeline()
  File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 1270, in ParsePipeline
    child = self.ParseCommand()
  File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 1252, in ParseCommand
    return self.ParseSimpleCommand()  # echo foo
  File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 599, in ParseSimpleCommand
    result = self._ScanSimpleCommand()
  File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 414, in _ScanSimpleCommand
    if not self._Peek(): return None
  File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 144, in _Peek
    w = self.w_parser.ReadWord(self.next_lex_mode)
  File "/home/andy/git/oil/bin/../osh/word_parse.py", line 1093, in ReadWord
    w, need_more = self._ReadWord(lex_mode)
  File "/home/andy/git/oil/bin/../osh/word_parse.py", line 1054, in _ReadWord
    w = self._ReadCompoundWord(lex_mode=lex_mode)
  File "/home/andy/git/oil/bin/../osh/word_parse.py", line 900, in _ReadCompoundWord
    part = self._ReadLeftParts()
  File "/home/andy/git/oil/bin/../osh/word_parse.py", line 512, in _ReadLeftParts
    return self._ReadDoubleQuotedPart()
  File "/home/andy/git/oil/bin/../osh/word_parse.py", line 574, in _ReadDoubleQuotedPart
    part = self._ReadDoubleQuotedLeftParts()
  File "/home/andy/git/oil/bin/../osh/word_parse.py", line 498, in _ReadDoubleQuotedLeftParts
    return self._ReadBracedBracedVarSub(d_quoted=True)
  File "/home/andy/git/oil/bin/../osh/word_parse.py", line 453, in _ReadBracedBracedVarSub
    part = self._ParseVarExpr(arg_lex_mode)
  File "/home/andy/git/oil/bin/../osh/word_parse.py", line 331, in _ParseVarExpr
    raise AssertionError("Invalid op token %s" % self.cur_token)
AssertionError: Invalid op token (token id:VOp2_LBracket val:"[" span_id:28)
bash40 Length op, index op, then transform op is not allowed

stdout:
3 3
stderr:
mksh40 Length op, index op, then transform op is not allowed

stdout:
stderr: 
/bin/mksh: <stdin>[2]: ${#a[0]/1/xxx}": bad substitution
osh40 Length op, index op, then transform op is not allowed

[osh stdout] Expected b'', got b'<core.base.ParseError object at 0x7fda027bae80>\nLine 2 of \'<stdin>\'\n echo "${#a[0]}" "${#a[0]/1/xxx}"\n ^\n---\n<core.base.ParseError object at 0x7fda027ba940>\nLine 2 of \'<stdin>\'\n echo "${#a[0]}" "${#a[0]/1/xxx}"\n ^\n---\n<core.base.ParseError object at 0x7fda027a35f8>\nLine 0 of \'<unknown>\'\n <token had no position info>\nNO COL\n---\n'

stdout:
<core.base.ParseError object at 0x7fda027bae80>
Line 2 of '<stdin>'
  echo "${#a[0]}" "${#a[0]/1/xxx}"
                          ^
---
<core.base.ParseError object at 0x7fda027ba940>
Line 2 of '<stdin>'
  echo "${#a[0]}" "${#a[0]/1/xxx}"
                          ^
---
<core.base.ParseError object at 0x7fda027a35f8>
Line 0 of '<unknown>'
  <token had no position info>
NO COL
---
stderr:
Expected } after length expression, got (token id:VOp2_Slash val:/ span_id:30)
Error reading command word
Error parsing AndOr in ParseCommandTerm
bash41 Array subscript not allowed on string

stdout:
abc
stderr:
mksh41 Array subscript not allowed on string

stdout:
abc
stderr:
osh42 Create a "user" array out of the argv array

[osh stdout] Expected b"['x y', 'z', 'a b', 'c', 'a b c']\n", got b''

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 378, in <module>
    sys.exit(main(sys.argv))
  File "bin/osh", line 368, in main
    return OshMain(main_argv)
  File "bin/osh", line 327, in OshMain
    status, cflow = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 758, in Execute
    status, cflow = self.Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 739, in Execute
    ok, val = self.ev.EvalCompoundWord(pair.rhs)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 580, in EvalCompoundWord
    ok, val = self.EvalWordPart(p, quoted=False)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 678, in EvalWordPart
    return self.EvalArrayLiteralPart(part)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 672, in EvalArrayLiteralPart
    raise AssertionError('Expected string')
AssertionError: Expected string