Results for assoc.test.sh

casebashoshosh_ALTdescription
0pass pass pass TODO: SETUP should be share
1pass pass pass create empty assoc array, put, then get
2pass FAIL FAIL retrieve indices with !
detailsdetails
3pass FAIL FAIL $a gives nothing
detailsdetails
4pass FAIL FAIL length of dict does not work
detailsdetails
5pass FAIL FAIL index by number doesn't work
detailsdetails
6pass FAIL FAIL index by key name
detailsdetails
7pass FAIL FAIL index by quoted string
detailsdetails
8pass FAIL FAIL index by unquoted string
detailsdetails
9pass FAIL FAIL index by unquoted string as arithmetic
detailsdetails
10pass FAIL FAIL WTF index by key name
detailsdetails
11pass pass pass Array stored in associative array gets converted to string
12BUG FAIL FAIL Can't initialize assoc array with indexed array
detailsdetailsdetails
13BUG pass pass Initializing indexed array with with assoc array drops the constants
details
14pass FAIL FAIL Append to associative array value
detailsdetails
15BUG pass pass Slice of associative array doesn't make sense in bash
details

23 passed, 0 ok, 0 known unimplemented, 3 known bugs, 11 failed, 0 skipped

Details on runs that didn't PASS

osh2 retrieve indices with !

[osh stdout] Expected "['foo', 'aa', 'a+1']\n", got "['0', '1', '2']\n"

stdout:
['0', '1', '2']
stderr:
osh_ALT2 retrieve indices with !

[osh_ALT stdout] Expected "['foo', 'aa', 'a+1']\n", got "['0', '1', '2']\n"

stdout:
['0', '1', '2']
stderr:
osh3 $a gives nothing

[osh stdout] Expected u'\n', got '[aa]=b [foo]=bar [a+1]=c\n'

stdout:
[aa]=b [foo]=bar [a+1]=c
stderr:
osh_ALT3 $a gives nothing

[osh_ALT stdout] Expected u'\n', got '[aa]=b [foo]=bar [a+1]=c\n'

stdout:
[aa]=b [foo]=bar [a+1]=c
stderr:
osh4 length of dict does not work

[osh stdout] Expected '0\n', got '3\n'

stdout:
3
stderr:
osh_ALT4 length of dict does not work

[osh_ALT stdout] Expected '0\n', got '3\n'

stdout:
3
stderr:
osh5 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]=c
stderr:
osh_ALT5 index by number doesn't work

[osh_ALT 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]=c
stderr:
osh6 index by key name

[osh stdout] Expected u'b bar c\n', got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
  echo "${a[aa]}" "${a[foo]}" "${a['a+1']}"
            ^~
[ stdin ]:3: fatal: Undefined value in arithmetic context (0 if shopt -u strict-arith)
osh_ALT6 index by key name

[osh_ALT stdout] Expected u'b bar c\n', got ''
[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
  echo "${a[aa]}" "${a[foo]}" "${a['a+1']}"
            ^~
[ stdin ]:3: fatal: Undefined value in arithmetic context (0 if shopt -u strict-arith)
osh7 index by quoted string

[osh stdout] Expected 'c\n', got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
  echo "${a['a+1']}"
            ^
[ stdin ]:3: fatal: Invalid integer constant 'a+1'
osh_ALT7 index by quoted string

[osh_ALT stdout] Expected 'c\n', got ''
[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
  echo "${a['a+1']}"
            ^
[ stdin ]:3: fatal: Invalid integer constant 'a+1'
osh8 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 865, in <module>
    main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 833, in main
    sys.exit(AppBundleMain(argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 803, in AppBundleMain
    status = ShellMain('osh', argv0, main_argv, login_shell)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 616, 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 162, in Batch
    is_control_flow, is_fatal = ex.ExecuteAndCatch(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_exec.py", line 1195, in ExecuteAndCatch
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oilshell/oil/osh/cmd_exec.py", line 1143, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/osh/cmd_exec.py", line 661, in _Dispatch
    arg_vec = self.word_ev.EvalWordSequence2(words)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1122, in EvalWordSequence2
    self._EvalWordToParts(w, False, part_vals)  # not double quoted
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 910, in _EvalWordToParts
    self._EvalWordPart(p, part_vals, quoted=quoted, is_subst=is_subst)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 839, in _EvalWordPart
    self._EvalDoubleQuotedPart(part, part_vals)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 523, in _EvalDoubleQuotedPart
    self._EvalWordPart(p, part_vals, quoted=True)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 874, in _EvalWordPart
    self._EvalBracedVarSub(part, part_vals, quoted)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 635, in _EvalBracedVarSub
    index = self.arith_ev.Eval(anode)
  File "/home/andy/git/oilshell/oil/osh/expr_eval.py", line 464, in Eval
    return lhs + rhs
TypeError: can only concatenate list (not "int") to list
osh_ALT8 index by unquoted string

[osh_ALT stdout] Expected 'c\n', got ''
[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 852, in _cpython_main_hook
    main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 833, in main
    sys.exit(AppBundleMain(argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 803, in AppBundleMain
    status = ShellMain('osh', argv0, main_argv, login_shell)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 616, 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 168, in Batch
    return status
  File "/home/andy/git/oilshell/oil/osh/cmd_exec.py", line 1195, in ExecuteAndCatch
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oilshell/oil/osh/cmd_exec.py", line 1143, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/osh/cmd_exec.py", line 1084, in _Dispatch
    libc.print_time(real, user, sys_)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1122, in EvalWordSequence2
    self._EvalWordToParts(w, False, part_vals)  # not double quoted
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 910, in _EvalWordToParts
    self._EvalWordPart(p, part_vals, quoted=quoted, is_subst=is_subst)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 839, in _EvalWordPart
    self._EvalDoubleQuotedPart(part, part_vals)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 523, in _EvalDoubleQuotedPart
    self._EvalWordPart(p, part_vals, quoted=True)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 874, in _EvalWordPart
    self._EvalBracedVarSub(part, part_vals, quoted)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 781, in _EvalBracedVarSub
    val = value.StrArray([])
  File "/home/andy/git/oilshell/oil/osh/expr_eval.py", line 464, in Eval
    return lhs + rhs
TypeError: can only concatenate list (not "int") to list
FATAL: couldn't import from app bundle '_tmp/oil-tar-test/oil-0.6.0/_bin/osh' (1)
Stripping the oil.ovm binary may cause this error.
See https://github.com/oilshell/oil/issues/47
osh9 index by unquoted string as arithmetic

[osh stdout] Expected u'\nc\n7\n', got '\n\n7\n'

stdout:

7
stderr:
osh_ALT9 index by unquoted string as arithmetic

[osh_ALT stdout] Expected u'\nc\n7\n', got '\n\n7\n'

stdout:

7
stderr:
osh10 WTF index by key name

[osh stdout] Expected u'bb dd\n', got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
  echo "${a[xx]}" "${a[cc]}"
            ^~
[ stdin ]:3: fatal: Undefined value in arithmetic context (0 if shopt -u strict-arith)
osh_ALT10 WTF index by key name

[osh_ALT stdout] Expected u'bb dd\n', got ''
[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
  echo "${a[xx]}" "${a[cc]}"
            ^~
[ stdin ]:3: fatal: Undefined value in arithmetic context (0 if shopt -u strict-arith)
bash12 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
osh12 Can't initialize assoc array with indexed array

[osh status] Expected 1, got 0

stdout:
stderr: 
osh_ALT12 Can't initialize assoc array with indexed array

[osh_ALT status] Expected 1, got 0

stdout:
stderr: 
bash13 Initializing indexed array with with assoc array drops the constants

stdout:
3
stderr:
osh14 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: fatal: Invalid integer constant 'x'
osh_ALT14 Append to associative array value

[osh_ALT stdout] Expected "['foobar']\n", got ''
[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
  a['x']+='foo'
    ^
[ array LValue in (source.Stdin comment:'') ]:2: fatal: Invalid integer constant 'x'
bash15 Slice of associative array doesn't make sense in bash

stdout:
['2', '1', '5']
['2', '1', '5']
['1', '5', '4']
['5', '4', '3']
['4', '3']
['3']
stderr: