90 passed, 7 ok, 4 known unimplemented, 7 known bugs, 27 failed, 0 skipped
osh | 1 $a gives first element of array [osh stdout] Expected b'1\n', got b'1 2 3\n' stdout: 1 2 3stderr: |
mksh | 3 local array stdout: stderr: /bin/mksh: <stdin>[2]: syntax error: '(' unexpected |
osh | 3 local array [osh stdout] Expected b"['1']\n", got b"['1', '2 3']\n" stdout: ['1', '2 3']stderr: |
mksh | 5 space before ( in array initialization stdout: 1stderr: |
osh | 5 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 1492, in ParseWholeFile if not self._NewlineOk(): return None File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 182, in _NewlineOk if not self._Peek(): File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 145, in _Peek w = self.w_parser.ReadWord(self.next_lex_mode) File "/home/andy/git/oil/bin/../osh/word_parse.py", line 1097, in ReadWord w, need_more = self._ReadWord(lex_mode) File "/home/andy/git/oil/bin/../osh/word_parse.py", line 1058, in _ReadWord w = self._ReadCompoundWord(lex_mode=lex_mode) File "/home/andy/git/oil/bin/../osh/word_parse.py", line 892, in _ReadCompoundWord part2 = self._ReadArrayLiteralPart() File "/home/andy/git/oil/bin/../osh/word_parse.py", line 838, in _ReadArrayLiteralPart assert self.cur_token.id == Id.Op_LParen, self.cur_token AssertionError: (token id:WS_Space val:" " span_id:1) |
osh | 6 empty array [osh stdout] Expected b'[]\n', got b"['']\n" stdout: ['']stderr: |
osh | 8 Assign to array index without initialization [osh stdout] Expected b"['9']\n", got b"['']\nUNDEFINED\n" stdout: [''] UNDEFINEDstderr: Unexpected error in execvpe('b[2]=9', ['b[2]=9'], ...): [Errno 2] No such file or directory: b'/home/andy/bin/b[2]=9' |
osh | 10 Retrieve out of bounds index [osh stdout] Expected b"['']\n", got b"['']\nUNDEFINED\n" stdout: [''] UNDEFINEDstderr: |
osh | 14 Retrieve all indices with ! [osh stdout] Expected b"['0', '1']\n", got b"['1', '2 3']\n" stdout: ['1', '2 3']stderr: |
mksh | 15 Retrieve indices for one value stdout: ['1']stderr: |
osh | 15 Retrieve indices for one value [osh stdout] Expected b"['']\n", got b"['2 3']\n" stdout: ['2 3']stderr: |
mksh | 16 Retrieve indices without [] stdout: ['a']stderr: |
osh | 17 All elements unquoted [osh stdout] Expected b"['1', '2', '3']\n", got b"['1', '2 3']\n" stdout: ['1', '2 3']stderr: |
osh | 19 $* [osh stdout] Expected b"['1', '2', '3']\n", got b"['1', '2 3']\n" stdout: ['1', '2 3']stderr: |
osh | 20 "$*" [osh stdout] Expected b"['1 2 3']\n", got b"['1', '2 3']\n" stdout: ['1', '2 3']stderr: |
osh | 22 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 857, in Execute status, cflow = self._Execute(node) File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 755, in _Execute status, cflow = self._Execute(child) # last status wins File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 735, in _Execute ok, val = self.ev.EvalCompoundWord(pair.rhs) File "/home/andy/git/oil/bin/../core/word_eval.py", line 492, in EvalCompoundWord v = self._EvalCompoundWord(word, ifs, do_glob, elide_empty) File "/home/andy/git/oil/bin/../core/word_eval.py", line 448, in _EvalCompoundWord assert isinstance(word, ast.CompoundWord), "Expected CompoundWord, got %s" % word AssertionError: Expected CompoundWord, got None |
mksh | 23 Exporting array doesn't do anything, not even first element stdout: stderr: /bin/mksh: <stdin>[1]: syntax error: '(' unexpected |
mksh | 24 Env with array stdout: stderr: /bin/mksh: <stdin>[1]: syntax error: '(' unexpected |
osh | 24 Env with array [osh stdout] Expected b'a\n(b b)\n', got b"<core.base.ParseError object at 0x7f4dde73e550>\nLine 1 of '<stdin>'\n A=a B=(b b) printenv.py A B\n ^\n---\n<core.base.ParseError object at 0x7f4dde734e10>\nLine 0 of '<unknown>'\n <token had no position info>\nNO COL\n---\n" stdout: <core.base.ParseError object at 0x7f4dde73e550> Line 1 of '<stdin>' A=a B=(b b) printenv.py A B ^ --- <core.base.ParseError object at 0x7f4dde734e10> 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 |
osh | 25 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' |
osh | 26 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' |
osh | 27 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' |
mksh | 28 Slice of array with [@] stdout: stderr: /bin/mksh: <stdin>[2]: ${a[@]: 1:2}": bad substitution |
osh | 28 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 857, in Execute status, cflow = self._Execute(node) File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 755, in _Execute status, cflow = self._Execute(child) # last status wins File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 655, in _Execute argv = self.ev.EvalWords(words) File "/home/andy/git/oil/bin/../core/word_eval.py", line 769, in EvalWords return self._EvalWords(words) File "/home/andy/git/oil/bin/../core/word_eval.py", line 759, in _EvalWords val = self._EvalCompoundWord(w, ifs=ifs, do_glob=do_glob) File "/home/andy/git/oil/bin/../core/word_eval.py", line 455, in _EvalCompoundWord val = self._EvalWordPart(p, quoted=False) # may raise File "/home/andy/git/oil/bin/../core/word_eval.py", line 657, in _EvalWordPart return self._EvalDoubleQuotedPart(part) File "/home/andy/git/oil/bin/../core/word_eval.py", line 712, in _EvalDoubleQuotedPart val = self._EvalWordPart(p, quoted=True) File "/home/andy/git/oil/bin/../core/word_eval.py", line 691, in _EvalWordPart defined, val = self._ApplyVarOps(defined, val, part) File "/home/andy/git/oil/bin/../core/word_eval.py", line 289, in _ApplyVarOps if part.suffix_op and LookupKind(part.suffix_op.op_id) == Kind.VTest: AttributeError: 'Slice' object has no attribute 'op_id' |
mksh | 29 Negative slice stdout: stderr: /bin/mksh: <stdin>[2]: ${a[@]: (-2):1}": bad substitution |
osh | 29 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 857, in Execute status, cflow = self._Execute(node) File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 755, in _Execute status, cflow = self._Execute(child) # last status wins File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 655, in _Execute argv = self.ev.EvalWords(words) File "/home/andy/git/oil/bin/../core/word_eval.py", line 769, in EvalWords return self._EvalWords(words) File "/home/andy/git/oil/bin/../core/word_eval.py", line 759, in _EvalWords val = self._EvalCompoundWord(w, ifs=ifs, do_glob=do_glob) File "/home/andy/git/oil/bin/../core/word_eval.py", line 455, in _EvalCompoundWord val = self._EvalWordPart(p, quoted=False) # may raise File "/home/andy/git/oil/bin/../core/word_eval.py", line 657, in _EvalWordPart return self._EvalDoubleQuotedPart(part) File "/home/andy/git/oil/bin/../core/word_eval.py", line 712, in _EvalDoubleQuotedPart val = self._EvalWordPart(p, quoted=True) File "/home/andy/git/oil/bin/../core/word_eval.py", line 691, in _EvalWordPart defined, val = self._ApplyVarOps(defined, val, part) File "/home/andy/git/oil/bin/../core/word_eval.py", line 289, in _ApplyVarOps if part.suffix_op and LookupKind(part.suffix_op.op_id) == Kind.VTest: AttributeError: 'Slice' object has no attribute 'op_id' |
mksh | 30 Slice with arithmetic stdout: stderr: /bin/mksh: <stdin>[3]: ${a[@]:i-4:2}": bad substitution |
osh | 30 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 857, in Execute status, cflow = self._Execute(node) File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 755, in _Execute status, cflow = self._Execute(child) # last status wins File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 655, in _Execute argv = self.ev.EvalWords(words) File "/home/andy/git/oil/bin/../core/word_eval.py", line 769, in EvalWords return self._EvalWords(words) File "/home/andy/git/oil/bin/../core/word_eval.py", line 759, in _EvalWords val = self._EvalCompoundWord(w, ifs=ifs, do_glob=do_glob) File "/home/andy/git/oil/bin/../core/word_eval.py", line 455, in _EvalCompoundWord val = self._EvalWordPart(p, quoted=False) # may raise File "/home/andy/git/oil/bin/../core/word_eval.py", line 657, in _EvalWordPart return self._EvalDoubleQuotedPart(part) File "/home/andy/git/oil/bin/../core/word_eval.py", line 712, in _EvalDoubleQuotedPart val = self._EvalWordPart(p, quoted=True) File "/home/andy/git/oil/bin/../core/word_eval.py", line 691, in _EvalWordPart defined, val = self._ApplyVarOps(defined, val, part) File "/home/andy/git/oil/bin/../core/word_eval.py", line 289, in _ApplyVarOps if part.suffix_op and LookupKind(part.suffix_op.op_id) == Kind.VTest: AttributeError: 'Slice' object has no attribute 'op_id' |
osh | 34 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 857, in Execute status, cflow = self._Execute(node) File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 755, in _Execute status, cflow = self._Execute(child) # last status wins File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 735, in _Execute ok, val = self.ev.EvalCompoundWord(pair.rhs) File "/home/andy/git/oil/bin/../core/word_eval.py", line 492, in EvalCompoundWord v = self._EvalCompoundWord(word, ifs, do_glob, elide_empty) File "/home/andy/git/oil/bin/../core/word_eval.py", line 448, in _EvalCompoundWord assert isinstance(word, ast.CompoundWord), "Expected CompoundWord, got %s" % word AssertionError: Expected CompoundWord, got None |
mksh | 35 Array syntax in wrong place stdout: stderr: /bin/mksh: <stdin>[1]: syntax error: '(' unexpected |
osh | 36 Empty array with :- [osh stdout] Expected b"['not', 'one', 'not one']\n", got b"['']\n" stdout: ['']stderr: |
mksh | 37 Single array with :- stdout: ['none', 'none']stderr: |
osh | 37 Single array with :- [osh stdout] Expected b"['none', '']\n", got b"['']\n" stdout: ['']stderr: |
mksh | 38 Stripping a whole array stdout: stderr: /bin/mksh: <stdin>[2]: ${files[@]%.c}: bad substitution |
osh | 38 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 857, in Execute status, cflow = self._Execute(node) File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 755, in _Execute status, cflow = self._Execute(child) # last status wins File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 655, in _Execute argv = self.ev.EvalWords(words) File "/home/andy/git/oil/bin/../core/word_eval.py", line 769, in EvalWords return self._EvalWords(words) File "/home/andy/git/oil/bin/../core/word_eval.py", line 759, in _EvalWords val = self._EvalCompoundWord(w, ifs=ifs, do_glob=do_glob) File "/home/andy/git/oil/bin/../core/word_eval.py", line 455, in _EvalCompoundWord val = self._EvalWordPart(p, quoted=False) # may raise File "/home/andy/git/oil/bin/../core/word_eval.py", line 691, in _EvalWordPart defined, val = self._ApplyVarOps(defined, val, part) File "/home/andy/git/oil/bin/../core/word_eval.py", line 383, in _ApplyVarOps print(op.words) AttributeError: 'StringUnary' object has no attribute 'words' |
bash | 39 Multiple subscripts not allowed stdout: ['123', '123']stderr: |
mksh | 39 Multiple subscripts not allowed stdout: stderr: /bin/mksh: <stdin>[2]: ${a[0][0]}": bad substitution |
osh | 39 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 1501, in ParseWholeFile node = self.ParseCommandTerm() File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 1409, in ParseCommandTerm child = self.ParseAndOr() File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 1274, in ParseAndOr left = self.ParsePipeline() File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 1210, in ParsePipeline child = self.ParseCommand() File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 1192, in ParseCommand return self.ParseSimpleCommand() # echo foo File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 536, in ParseSimpleCommand result = self._ScanSimpleCommand() File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 348, in _ScanSimpleCommand if not self._Peek(): return None File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 145, in _Peek w = self.w_parser.ReadWord(self.next_lex_mode) File "/home/andy/git/oil/bin/../osh/word_parse.py", line 1097, in ReadWord w, need_more = self._ReadWord(lex_mode) File "/home/andy/git/oil/bin/../osh/word_parse.py", line 1058, in _ReadWord w = self._ReadCompoundWord(lex_mode=lex_mode) File "/home/andy/git/oil/bin/../osh/word_parse.py", line 904, in _ReadCompoundWord part = self._ReadLeftParts() File "/home/andy/git/oil/bin/../osh/word_parse.py", line 513, in _ReadLeftParts return self._ReadDoubleQuotedPart() File "/home/andy/git/oil/bin/../osh/word_parse.py", line 575, in _ReadDoubleQuotedPart part = self._ReadDoubleQuotedLeftParts() File "/home/andy/git/oil/bin/../osh/word_parse.py", line 499, in _ReadDoubleQuotedLeftParts return self._ReadBracedBracedVarSub(d_quoted=True) File "/home/andy/git/oil/bin/../osh/word_parse.py", line 454, in _ReadBracedBracedVarSub part = self._ParseVarExpr(arg_lex_mode) File "/home/andy/git/oil/bin/../osh/word_parse.py", line 332, in _ParseVarExpr raise AssertionError("Invalid op token %s" % self.cur_token) AssertionError: Invalid op token (token id:VOp2_LBracket val:"[" span_id:28) |
bash | 40 Length op, index op, then transform op is not allowed stdout: 3 3stderr: |
mksh | 40 Length op, index op, then transform op is not allowed stdout: stderr: /bin/mksh: <stdin>[2]: ${#a[0]/1/xxx}": bad substitution |
osh | 40 Length op, index op, then transform op is not allowed [osh stdout] Expected b'', got b'<core.base.ParseError object at 0x7f065395ba90>\nLine 2 of \'<stdin>\'\n echo "${#a[0]}" "${#a[0]/1/xxx}"\n ^\n---\n<core.base.ParseError object at 0x7f065395b550>\nLine 2 of \'<stdin>\'\n echo "${#a[0]}" "${#a[0]/1/xxx}"\n ^\n---\n<core.base.ParseError object at 0x7f0653950b38>\nLine 0 of \'<unknown>\'\n <token had no position info>\nNO COL\n---\n' stdout: <core.base.ParseError object at 0x7f065395ba90> Line 2 of '<stdin>' echo "${#a[0]}" "${#a[0]/1/xxx}" ^ --- <core.base.ParseError object at 0x7f065395b550> Line 2 of '<stdin>' echo "${#a[0]}" "${#a[0]/1/xxx}" ^ --- <core.base.ParseError object at 0x7f0653950b38> 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 |
bash | 41 Array subscript not allowed on string stdout: abcstderr: |
mksh | 41 Array subscript not allowed on string stdout: abcstderr: |
osh | 41 Array subscript not allowed on string [osh status] Expected 1, got 0 stdout: stderr: |
osh | 42 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"['x y', 'z', 'a b', 'c', 'a b', 'c']\n" stdout: ['x y', 'z', 'a b', 'c', 'a b', 'c']stderr: |