spec test index / oilshell.org
| case | bash | osh | description |
| 0 | pass | pass | TODO: SETUP should be share |
| 1 | pass | pass | create empty assoc array, put, then get |
| 2 | pass | FAIL | retrieve indices with ! |
| details | |||
| 3 | pass | FAIL | $a gives nothing |
| details | |||
| 4 | pass | FAIL | length of dict does not work |
| details | |||
| 5 | pass | FAIL | index by number doesn't work |
| details | |||
| 6 | pass | FAIL | index by key name |
| details | |||
| 7 | pass | FAIL | index by quoted string |
| details | |||
| 8 | pass | FAIL | index by unquoted string |
| details | |||
| 9 | pass | FAIL | index by unquoted string as arithmetic |
| details | |||
| 10 | pass | FAIL | WTF index by key name |
| details | |||
| 11 | pass | pass | Array stored in associative array gets converted to string |
| 12 | BUG | FAIL | Can't initialize assoc array with indexed array |
| details | details | ||
| 13 | BUG | pass | Initializing indexed array with with assoc array drops the constants |
| details | |||
| 14 | pass | FAIL | Append to associative array value |
| details |
17 passed, 0 ok, 0 known unimplemented, 2 known bugs, 11 failed, 0 skipped
| osh | 2 retrieve indices with ! [osh stdout] Expected "['foo', 'aa', 'a+1']\n", got "['0', '1', '2']\n" stdout: ['0', '1', '2']stderr: |
| osh | 3 $a gives nothing [osh stdout] Expected u'\n', got '[aa]=b [foo]=bar [a+1]=c\n' stdout: [aa]=b [foo]=bar [a+1]=cstderr: |
| osh | 4 length of dict does not work [osh stdout] Expected '0\n', got '3\n' stdout: 3stderr: |
| osh | 5 index by number doesn't work [osh stdout] Expected u'0 1 2 \n', got '0 [aa]=b 1 [foo]=bar 2 [a+1]=c\n' stdout: 0 [aa]=b 1 [foo]=bar 2 [a+1]=cstderr: |
| osh | 6 index by key name [osh stdout] Expected u'b bar c\n', got '[aa]=b [aa]=b [aa]=b\n' stdout: [aa]=b [aa]=b [aa]=bstderr: echo "${a[aa]}" "${a[foo]}" "${a['a+1']}"
^~
[ stdin ]:3: warning: Coercing undefined value to 0 in arithmetic context
echo "${a[aa]}" "${a[foo]}" "${a['a+1']}"
^~~
[ stdin ]:3: warning: Coercing undefined value to 0 in arithmetic context
echo "${a[aa]}" "${a[foo]}" "${a['a+1']}"
^
[ stdin ]:3: warning: Invalid integer constant 'a+1'
|
| osh | 7 index by quoted string [osh stdout] Expected 'c\n', got '[aa]=b\n' stdout: [aa]=bstderr: echo "${a['a+1']}"
^
[ stdin ]:3: warning: Invalid integer constant 'a+1'
|
| osh | 8 index by unquoted string [osh stdout] Expected 'c\n', got '' [osh status] Expected 0, got 1 stdout: stderr: Traceback (most recent call last):
File "/home/andy/git/oilshell/oil/bin/oil.py", line 778, in <module>
main(sys.argv)
File "/home/andy/git/oilshell/oil/bin/oil.py", line 747, in main
sys.exit(AppBundleMain(argv))
File "/home/andy/git/oilshell/oil/bin/oil.py", line 721, in AppBundleMain
status = ShellMain('osh', argv0, main_argv, login_shell)
File "/home/andy/git/oilshell/oil/bin/oil.py", line 542, in ShellMain
status = main_loop.Batch(ex, c_parser, arena, nodes_out=nodes_out)
File "/home/andy/git/oilshell/oil/core/main_loop.py", line 160, in Batch
is_control_flow, is_fatal = ex.ExecuteAndCatch(node)
File "/home/andy/git/oilshell/oil/osh/cmd_exec.py", line 1240, in ExecuteAndCatch
status = self._Execute(node, fork_external=fork_external)
File "/home/andy/git/oilshell/oil/osh/cmd_exec.py", line 1188, in _Execute
status, check_errexit = self._Dispatch(node, fork_external)
File "/home/andy/git/oilshell/oil/osh/cmd_exec.py", line 717, in _Dispatch
arg_vec = self.word_ev.EvalWordSequence2(words)
File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1110, in EvalWordSequence2
self._EvalWordToParts(w, False, part_vals) # not double quoted
File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 891, in _EvalWordToParts
self._EvalWordPart(p, part_vals, quoted=quoted)
File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 819, in _EvalWordPart
self._EvalDoubleQuotedPart(part, part_vals)
File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 463, in _EvalDoubleQuotedPart
self._EvalWordPart(p, part_vals, quoted=True)
File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 854, in _EvalWordPart
self._EvalBracedVarSub(part, part_vals, quoted)
File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 575, in _EvalBracedVarSub
index = self.arith_ev.Eval(anode)
File "/home/andy/git/oilshell/oil/osh/expr_eval.py", line 473, in Eval
return lhs + rhs
TypeError: can only concatenate list (not "int") to list
|
| osh | 9 index by unquoted string as arithmetic [osh stdout] Expected u'\nc\n7\n', got '\n\n7\n' stdout: 7stderr: |
| osh | 10 WTF index by key name [osh stdout] Expected u'bb dd\n', got '[xx]=bb [xx]=bb\n' stdout: [xx]=bb [xx]=bbstderr: echo "${a[xx]}" "${a[cc]}"
^~
[ stdin ]:3: warning: Coercing undefined value to 0 in arithmetic context
echo "${a[xx]}" "${a[cc]}"
^~
[ stdin ]:3: warning: Coercing undefined value to 0 in arithmetic context
|
| bash | 12 Can't initialize assoc array with indexed array stdout: stderr: _tmp/spec-bin/bash: line 1: A: 1: must use subscript when assigning associative array _tmp/spec-bin/bash: line 1: A: 2: must use subscript when assigning associative array _tmp/spec-bin/bash: line 1: A: 3: must use subscript when assigning associative array |
| osh | 12 Can't initialize assoc array with indexed array [osh status] Expected 1, got 0 stdout: stderr: |
| bash | 13 Initializing indexed array with with assoc array drops the constants stdout: 3stderr: |
| osh | 14 Append to associative array value [osh stdout] Expected "['foobar']\n", got '' [osh status] Expected 0, got 1 stdout: stderr: a['x']+='foo'
^
[ array LValue in (source.Stdin comment:'') ]:2: warning: Invalid integer constant 'x'
a['x']+='bar'
^
[ array LValue in (source.Stdin comment:'') ]:3: warning: Invalid integer constant 'x'
Traceback (most recent call last):
File "/home/andy/git/oilshell/oil/bin/oil.py", line 778, in <module>
main(sys.argv)
File "/home/andy/git/oilshell/oil/bin/oil.py", line 747, in main
sys.exit(AppBundleMain(argv))
File "/home/andy/git/oilshell/oil/bin/oil.py", line 721, in AppBundleMain
status = ShellMain('osh', argv0, main_argv, login_shell)
File "/home/andy/git/oilshell/oil/bin/oil.py", line 542, in ShellMain
status = main_loop.Batch(ex, c_parser, arena, nodes_out=nodes_out)
File "/home/andy/git/oilshell/oil/core/main_loop.py", line 160, in Batch
is_control_flow, is_fatal = ex.ExecuteAndCatch(node)
File "/home/andy/git/oilshell/oil/osh/cmd_exec.py", line 1240, in ExecuteAndCatch
status = self._Execute(node, fork_external=fork_external)
File "/home/andy/git/oilshell/oil/osh/cmd_exec.py", line 1188, in _Execute
status, check_errexit = self._Dispatch(node, fork_external)
File "/home/andy/git/oilshell/oil/osh/cmd_exec.py", line 821, in _Dispatch
self.mem, self.exec_opts)
File "/home/andy/git/oilshell/oil/osh/expr_eval.py", line 208, in EvalLhsAndLookup
raise NotImplementedError
NotImplementedError
|