spec test index / oilshell.org
249 passed, 21 ok, 9 known unimplemented, 4 known bugs, 4 failed, 0 skipped
mksh | 6 nounset with empty array (design bug, makes it hard to use arrays) stdout: stderr: _tmp/spec-bin/mksh: <stdin>[3]: empty[@]: parameter not set |
mksh | 7 local array stdout: stderr: _tmp/spec-bin/mksh: <stdin>[2]: syntax error: '(' unexpected |
mksh | 9 space before ( in array initialization stdout: 1stderr: |
mksh | 11 array with invalid token stdout: stderr: _tmp/spec-bin/mksh: <stdin>[3]: syntax error: '&' unexpected |
mksh | 15 Negative index stdout: ['', '', '']stderr: |
osh | 19 Retrieve all indices with ! [osh stdout] Expected "['0', '1']\n", got '' [osh status] Expected 0, got 1 stdout: stderr: Traceback (most recent call last): File "bin/osh", line 526, in <module> main(sys.argv) File "bin/osh", line 504, in main sys.exit(AppBundleMain(argv)) File "bin/osh", line 478, in AppBundleMain status = OshMain(argv0, main_argv, login_shell) File "bin/osh", line 282, in OshMain status = main_loop.Batch(ex, c_parser, arena, nodes_out=nodes_out) File "/home/andy/git/oilshell/oil/bin/../core/main_loop.py", line 106, in Batch is_control_flow, is_fatal = ex.ExecuteAndCatch(node) File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 1195, in ExecuteAndCatch status = self._Execute(node, fork_external=fork_external) File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 1143, in _Execute status, check_errexit = self._Dispatch(node, fork_external) File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 685, in _Dispatch argv = self.word_ev.EvalWordSequence(words) File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1068, in EvalWordSequence return self._EvalWordSequence(words) File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1041, in _EvalWordSequence self._EvalWordToParts(w, False, part_vals) # not double quoted File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 836, in _EvalWordToParts self._EvalWordPart(p, part_vals, quoted=quoted) File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 764, in _EvalWordPart self._EvalDoubleQuotedPart(part, part_vals) File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 417, in _EvalDoubleQuotedPart self._EvalWordPart(p, part_vals, quoted=True) File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 799, in _EvalWordPart self._EvalBracedVarSub(part, part_vals, quoted) File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 556, in _EvalBracedVarSub val = self._ApplyPrefixOp(val, part.prefix_op) File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 359, in _ApplyPrefixOp raise NotImplementedError('${!a[@]}') # bash gets keys this way NotImplementedError: ${!a[@]} |
osh_ALT | 19 Retrieve all indices with ! [osh_ALT stdout] Expected "['0', '1']\n", got '' [osh_ALT status] Expected 0, got 1 stdout: stderr: Traceback (most recent call last): File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 174, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 72, in _run_code exec code in run_globals File "/home/andy/git/oilshell/oil/bin/oil.py", line 526, in <module> main(sys.argv) File "/home/andy/git/oilshell/oil/bin/oil.py", line 504, in main sys.exit(AppBundleMain(argv)) File "/home/andy/git/oilshell/oil/bin/oil.py", line 478, in AppBundleMain status = OshMain(argv0, main_argv, login_shell) File "/home/andy/git/oilshell/oil/bin/oil.py", line 282, in OshMain status = main_loop.Batch(ex, c_parser, arena, nodes_out=nodes_out) File "/home/andy/git/oilshell/oil/core/main_loop.py", line 113, in Batch return ex.LastStatus() File "/home/andy/git/oilshell/oil/core/cmd_exec.py", line 1195, in ExecuteAndCatch status = self._Execute(node, fork_external=fork_external) File "/home/andy/git/oilshell/oil/core/cmd_exec.py", line 1143, in _Execute status, check_errexit = self._Dispatch(node, fork_external) File "/home/andy/git/oilshell/oil/core/cmd_exec.py", line 1088, in _Dispatch libc.print_time(real, user, sys_) File "/home/andy/git/oilshell/oil/core/word_eval.py", line 1068, in EvalWordSequence return self._EvalWordSequence(words) File "/home/andy/git/oilshell/oil/core/word_eval.py", line 1041, in _EvalWordSequence self._EvalWordToParts(w, False, part_vals) # not double quoted File "/home/andy/git/oilshell/oil/core/word_eval.py", line 836, in _EvalWordToParts self._EvalWordPart(p, part_vals, quoted=quoted) File "/home/andy/git/oilshell/oil/core/word_eval.py", line 822, in _EvalWordPart part_vals.append(runtime.StringPartValue(')', True)) # closing ) File "/home/andy/git/oilshell/oil/core/word_eval.py", line 417, in _EvalDoubleQuotedPart self._EvalWordPart(p, part_vals, quoted=True) File "/home/andy/git/oilshell/oil/core/word_eval.py", line 799, in _EvalWordPart self._EvalBracedVarSub(part, part_vals, quoted) File "/home/andy/git/oilshell/oil/core/word_eval.py", line 556, in _EvalBracedVarSub val = self._ApplyPrefixOp(val, part.prefix_op) File "/home/andy/git/oilshell/oil/core/word_eval.py", line 359, in _ApplyPrefixOp raise NotImplementedError('${!a[@]}') # bash gets keys this way NotImplementedError: ${!a[@]} FATAL: couldn't import from app bundle '_tmp/oil-tar-test/oil-0.6.pre6/_bin/osh' (1) Stripping the oil.ovm binary may cause this error. See https://github.com/oilshell/oil/issues/47 |
osh-byterun | 19 Retrieve all indices with ! [osh-byterun stdout] Expected "['0', '1']\n", got '' [osh-byterun status] Expected 0, got 1 stdout: stderr: FATAL: ${!a[@]} |
mksh | 20 ${!a[1]} is named ref in bash stdout: ['a[1]']stderr: |
mksh | 21 ${!a} on array stdout: ['a']stderr: |
osh | 21 ${!a} on array [osh stdout] Expected "['']\n", got '' [osh status] Expected 0, got 1 stdout: stderr: Traceback (most recent call last): File "bin/osh", line 526, in <module> main(sys.argv) File "bin/osh", line 504, in main sys.exit(AppBundleMain(argv)) File "bin/osh", line 478, in AppBundleMain status = OshMain(argv0, main_argv, login_shell) File "bin/osh", line 282, in OshMain status = main_loop.Batch(ex, c_parser, arena, nodes_out=nodes_out) File "/home/andy/git/oilshell/oil/bin/../core/main_loop.py", line 106, in Batch is_control_flow, is_fatal = ex.ExecuteAndCatch(node) File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 1195, in ExecuteAndCatch status = self._Execute(node, fork_external=fork_external) File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 1143, in _Execute status, check_errexit = self._Dispatch(node, fork_external) File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 685, in _Dispatch argv = self.word_ev.EvalWordSequence(words) File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1068, in EvalWordSequence return self._EvalWordSequence(words) File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1041, in _EvalWordSequence self._EvalWordToParts(w, False, part_vals) # not double quoted File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 836, in _EvalWordToParts self._EvalWordPart(p, part_vals, quoted=quoted) File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 764, in _EvalWordPart self._EvalDoubleQuotedPart(part, part_vals) File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 417, in _EvalDoubleQuotedPart self._EvalWordPart(p, part_vals, quoted=True) File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 799, in _EvalWordPart self._EvalBracedVarSub(part, part_vals, quoted) File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 556, in _EvalBracedVarSub val = self._ApplyPrefixOp(val, part.prefix_op) File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 359, in _ApplyPrefixOp raise NotImplementedError('${!a[@]}') # bash gets keys this way NotImplementedError: ${!a[@]} |
osh_ALT | 21 ${!a} on array [osh_ALT stdout] Expected "['']\n", got '' [osh_ALT status] Expected 0, got 1 stdout: stderr: Traceback (most recent call last): File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 174, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 72, in _run_code exec code in run_globals File "/home/andy/git/oilshell/oil/bin/oil.py", line 526, in <module> main(sys.argv) File "/home/andy/git/oilshell/oil/bin/oil.py", line 504, in main sys.exit(AppBundleMain(argv)) File "/home/andy/git/oilshell/oil/bin/oil.py", line 478, in AppBundleMain status = OshMain(argv0, main_argv, login_shell) File "/home/andy/git/oilshell/oil/bin/oil.py", line 282, in OshMain status = main_loop.Batch(ex, c_parser, arena, nodes_out=nodes_out) File "/home/andy/git/oilshell/oil/core/main_loop.py", line 113, in Batch return ex.LastStatus() File "/home/andy/git/oilshell/oil/core/cmd_exec.py", line 1195, in ExecuteAndCatch status = self._Execute(node, fork_external=fork_external) File "/home/andy/git/oilshell/oil/core/cmd_exec.py", line 1143, in _Execute status, check_errexit = self._Dispatch(node, fork_external) File "/home/andy/git/oilshell/oil/core/cmd_exec.py", line 1088, in _Dispatch libc.print_time(real, user, sys_) File "/home/andy/git/oilshell/oil/core/word_eval.py", line 1068, in EvalWordSequence return self._EvalWordSequence(words) File "/home/andy/git/oilshell/oil/core/word_eval.py", line 1041, in _EvalWordSequence self._EvalWordToParts(w, False, part_vals) # not double quoted File "/home/andy/git/oilshell/oil/core/word_eval.py", line 836, in _EvalWordToParts self._EvalWordPart(p, part_vals, quoted=quoted) File "/home/andy/git/oilshell/oil/core/word_eval.py", line 822, in _EvalWordPart part_vals.append(runtime.StringPartValue(')', True)) # closing ) File "/home/andy/git/oilshell/oil/core/word_eval.py", line 417, in _EvalDoubleQuotedPart self._EvalWordPart(p, part_vals, quoted=True) File "/home/andy/git/oilshell/oil/core/word_eval.py", line 799, in _EvalWordPart self._EvalBracedVarSub(part, part_vals, quoted) File "/home/andy/git/oilshell/oil/core/word_eval.py", line 556, in _EvalBracedVarSub val = self._ApplyPrefixOp(val, part.prefix_op) File "/home/andy/git/oilshell/oil/core/word_eval.py", line 359, in _ApplyPrefixOp raise NotImplementedError('${!a[@]}') # bash gets keys this way NotImplementedError: ${!a[@]} FATAL: couldn't import from app bundle '_tmp/oil-tar-test/oil-0.6.pre6/_bin/osh' (1) Stripping the oil.ovm binary may cause this error. See https://github.com/oilshell/oil/issues/47 |
osh-byterun | 21 ${!a} on array [osh-byterun stdout] Expected "['']\n", got '' [osh-byterun status] Expected 0, got 1 stdout: stderr: FATAL: ${!a[@]} |
mksh | 27 Exporting array doesn't do anything, not even first element stdout: stderr: _tmp/spec-bin/mksh: <stdin>[1]: syntax error: '(' unexpected |
osh | 27 Exporting array doesn't do anything, not even first element stdout: stderr: Line 1 of '<stdin>' export PYTHONPATH=(a b c) ^~~~~~~~~~~ Commands can't contain array literals |
osh_ALT | 27 Exporting array doesn't do anything, not even first element stdout: stderr: Line 1 of '<stdin>' export PYTHONPATH=(a b c) ^~~~~~~~~~~ Commands can't contain array literals |
osh-byterun | 27 Exporting array doesn't do anything, not even first element stdout: stderr: Line 1 of '<stdin>' export PYTHONPATH=(a b c) ^~~~~~~~~~~ Commands can't contain array literals |
bash | 28 Arrays can't be used as env bindings stdout: a (b b)stderr: |
mksh | 28 Arrays can't be used as env bindings stdout: stderr: _tmp/spec-bin/mksh: <stdin>[1]: syntax error: '(' unexpected |
mksh | 32 Set array item to array stdout: stderr: _tmp/spec-bin/mksh: <stdin>[2]: set: a[0]: is not an identifier |
osh | 32 Set array item to array [osh stdout] Expected 'status=1\n', got '' [osh status] Expected 0, got 2 stdout: stderr: Line 2 of '<stdin>' a[0]=(3 4) ^ Expected word type Right_FuncDef, got Word_Compound |
osh_ALT | 32 Set array item to array [osh_ALT stdout] Expected 'status=1\n', got '' [osh_ALT status] Expected 0, got 2 stdout: stderr: Line 2 of '<stdin>' a[0]=(3 4) ^ Expected word type Right_FuncDef, got Word_Compound |
osh-byterun | 32 Set array item to array [osh-byterun stdout] Expected 'status=1\n', got '' [osh-byterun status] Expected 0, got 2 stdout: stderr: Line 2 of '<stdin>' a[0]=(3 4) ^ Expected word type Right_FuncDef, got Word_Compound |
mksh | 33 Slice of array with [@] stdout: stderr: _tmp/spec-bin/mksh: <stdin>[2]: ${a[@]: 1:2}: bad substitution |
mksh | 34 Negative slice stdout: stderr: _tmp/spec-bin/mksh: <stdin>[2]: ${a[@]: (-2):1}: bad substitution |
mksh | 35 Slice with arithmetic stdout: stderr: _tmp/spec-bin/mksh: <stdin>[3]: ${a[@]:i-4:2}: bad substitution |
mksh | 41 Array syntax in wrong place stdout: stderr: _tmp/spec-bin/mksh: <stdin>[1]: syntax error: '(' unexpected |
bash | 42 Single array with :- stdout: ['none', 'x', '']stderr: |
mksh | 42 Single array with :- stdout: ['none', 'x', 'none']stderr: |
osh | 42 Single array with :- stdout: ['x', '']stderr: |
osh_ALT | 42 Single array with :- stdout: ['x', '']stderr: |
osh-byterun | 42 Single array with :- stdout: ['x', '']stderr: |
mksh | 43 Stripping a whole array unquoted stdout: stderr: _tmp/spec-bin/mksh: <stdin>[2]: ${files[@]%.c}: bad substitution |
mksh | 44 Stripping a whole array quoted stdout: stderr: _tmp/spec-bin/mksh: <stdin>[2]: ${files[@]%.c}: bad substitution |
bash | 45 Multiple subscripts not allowed stdout: stderr: _tmp/spec-bin/bash: line 2: ${a[0][0]}: bad substitution |
mksh | 45 Multiple subscripts not allowed stdout: stderr: _tmp/spec-bin/mksh: <stdin>[2]: ${a[0][0]}: bad substitution |
bash | 46 Length op, index op, then transform op is not allowed stdout: stderr: _tmp/spec-bin/bash: line 2: ${#a[0]/1/xxx}: bad substitution |
mksh | 46 Length op, index op, then transform op is not allowed stdout: stderr: _tmp/spec-bin/mksh: <stdin>[2]: ${#a[0]/1/xxx}: bad substitution |
bash | 47 Array subscript not allowed on string stdout: abcstderr: |
mksh | 47 Array subscript not allowed on string stdout: abcstderr: |
bash | 52 Singleton Array Copy and Assign. Can't index string with int. stdout: 4 4 1 1 4 4 1 1stderr: |
mksh | 52 Singleton Array Copy and Assign. Can't index string with int. stdout: 4 4 1 1 4 4 1 1stderr: |
mksh | 57 Slice of sparse array with [@] stdout: stderr: _tmp/spec-bin/mksh: <stdin>[4]: ${a[@]: 15:2}: bad substitution |
osh | 58 Using an array itself as the index [osh stdout] Expected "['42', '99', '42', '99', '']\n", got '' [osh status] Expected 0, got 1 stdout: stderr: Line 1 of '<stdin>' a[a]=42 ^~ osh warning: Coercing undefined value to 0 in arithmetic context Traceback (most recent call last): File "bin/osh", line 526, in <module> main(sys.argv) File "bin/osh", line 504, in main sys.exit(AppBundleMain(argv)) File "bin/osh", line 478, in AppBundleMain status = OshMain(argv0, main_argv, login_shell) File "bin/osh", line 282, in OshMain status = main_loop.Batch(ex, c_parser, arena, nodes_out=nodes_out) File "/home/andy/git/oilshell/oil/bin/../core/main_loop.py", line 106, in Batch is_control_flow, is_fatal = ex.ExecuteAndCatch(node) File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 1195, in ExecuteAndCatch status = self._Execute(node, fork_external=fork_external) File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 1143, in _Execute status, check_errexit = self._Dispatch(node, fork_external) File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 806, in _Dispatch strict_array=self.exec_opts.strict_array) File "/home/andy/git/oilshell/oil/bin/../core/state.py", line 864, in SetVar strs[lval.index] = value.s TypeError: list indices must be integers, not list |
osh_ALT | 58 Using an array itself as the index [osh_ALT stdout] Expected "['42', '99', '42', '99', '']\n", got '' [osh_ALT status] Expected 0, got 1 stdout: stderr: Line 1 of '<stdin>' a[a]=42 ^~ osh warning: Coercing undefined value to 0 in arithmetic context Traceback (most recent call last): File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 174, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 72, in _run_code exec code in run_globals File "/home/andy/git/oilshell/oil/bin/oil.py", line 526, in <module> main(sys.argv) File "/home/andy/git/oilshell/oil/bin/oil.py", line 504, in main sys.exit(AppBundleMain(argv)) File "/home/andy/git/oilshell/oil/bin/oil.py", line 478, in AppBundleMain status = OshMain(argv0, main_argv, login_shell) File "/home/andy/git/oilshell/oil/bin/oil.py", line 282, in OshMain status = main_loop.Batch(ex, c_parser, arena, nodes_out=nodes_out) File "/home/andy/git/oilshell/oil/core/main_loop.py", line 113, in Batch return ex.LastStatus() File "/home/andy/git/oilshell/oil/core/cmd_exec.py", line 1195, in ExecuteAndCatch status = self._Execute(node, fork_external=fork_external) File "/home/andy/git/oilshell/oil/core/cmd_exec.py", line 1143, in _Execute status, check_errexit = self._Dispatch(node, fork_external) File "/home/andy/git/oilshell/oil/core/cmd_exec.py", line 1088, in _Dispatch libc.print_time(real, user, sys_) File "/home/andy/git/oilshell/oil/core/state.py", line 864, in SetVar strs[lval.index] = value.s TypeError: list indices must be integers, not list FATAL: couldn't import from app bundle '_tmp/oil-tar-test/oil-0.6.pre6/_bin/osh' (1) Stripping the oil.ovm binary may cause this error. See https://github.com/oilshell/oil/issues/47 |
osh-byterun | 58 Using an array itself as the index [osh-byterun stdout] Expected "['42', '99', '42', '99', '']\n", got '' [osh-byterun status] Expected 0, got 1 stdout: stderr: Line 1 of '<stdin>' a[a]=42 ^~ osh warning: Coercing undefined value to 0 in arithmetic context Traceback (most recent call last): File "/home/andy/git/oilshell/oil/bin/opy_.py", line 88, in <module> main(sys.argv) File "/home/andy/git/oilshell/oil/bin/opy_.py", line 72, in main sys.exit(AppBundleMain(argv)) File "/home/andy/git/oilshell/oil/bin/opy_.py", line 64, in AppBundleMain return opy_main.OpyCommandMain(main_argv) File "/home/andy/git/oilshell/oil/opy/opy_main.py", line 477, in OpyCommandMain num_ticks = ovm.run_code_object(co, opy_argv) File "/home/andy/git/oilshell/oil/opy/byterun/execfile.py", line 36, in run_code_object pyvm2.run_code(vm, code, f_globals=main_mod.__dict__) File "/home/andy/git/oilshell/oil/opy/byterun/pyvm2.py", line 88, in run_code val = vm.run_frame(frame) File "/home/andy/git/oilshell/oil/opy/byterun/pyvm2.py", line 327, in run_frame raise exctype, value, tb TypeError: list indices must be integers, not list |