Results for assoc.test.sh

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

25 passed, 0 ok, 0 known unimplemented, 2 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:
osh-byterun2 retrieve indices with !

[osh-byterun 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:
osh-byterun3 $a gives nothing

[osh-byterun 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:
osh-byterun4 length of dict does not work

[osh-byterun 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:
osh-byterun5 index by number doesn't work

[osh-byterun 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 '[aa]=b [aa]=b [aa]=b\n'

stdout:
[aa]=b [aa]=b [aa]=b
stderr:
Line 3 of '<stdin>'
  echo "${a[aa]}" "${a[foo]}" "${a['a+1']}"
            ^~
osh warning: Coercing undefined value to 0 in arithmetic context
Line 3 of '<stdin>'
  echo "${a[aa]}" "${a[foo]}" "${a['a+1']}"
                       ^~~
osh warning: Coercing undefined value to 0 in arithmetic context
Line 3 of '<stdin>'
  echo "${a[aa]}" "${a[foo]}" "${a['a+1']}"
                                   ^
osh warning: Invalid integer constant 'a+1'
osh_ALT6 index by key name

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

stdout:
[aa]=b [aa]=b [aa]=b
stderr:
Line 3 of '<stdin>'
  echo "${a[aa]}" "${a[foo]}" "${a['a+1']}"
            ^~
osh warning: Coercing undefined value to 0 in arithmetic context
Line 3 of '<stdin>'
  echo "${a[aa]}" "${a[foo]}" "${a['a+1']}"
                       ^~~
osh warning: Coercing undefined value to 0 in arithmetic context
Line 3 of '<stdin>'
  echo "${a[aa]}" "${a[foo]}" "${a['a+1']}"
                                   ^
osh warning: Invalid integer constant 'a+1'
osh-byterun6 index by key name

[osh-byterun stdout] Expected u'b bar c\n', got '[aa]=b [aa]=b [aa]=b\n'

stdout:
[aa]=b [aa]=b [aa]=b
stderr:
Line 3 of '<stdin>'
  echo "${a[aa]}" "${a[foo]}" "${a['a+1']}"
            ^~
osh warning: Coercing undefined value to 0 in arithmetic context
Line 3 of '<stdin>'
  echo "${a[aa]}" "${a[foo]}" "${a['a+1']}"
                       ^~~
osh warning: Coercing undefined value to 0 in arithmetic context
Line 3 of '<stdin>'
  echo "${a[aa]}" "${a[foo]}" "${a['a+1']}"
                                   ^
osh warning: Invalid integer constant 'a+1'
osh7 index by quoted string

[osh stdout] Expected 'c\n', got '[aa]=b\n'

stdout:
[aa]=b
stderr:
Line 3 of '<stdin>'
  echo "${a['a+1']}"
            ^
osh warning: Invalid integer constant 'a+1'
osh_ALT7 index by quoted string

[osh_ALT stdout] Expected 'c\n', got '[aa]=b\n'

stdout:
[aa]=b
stderr:
Line 3 of '<stdin>'
  echo "${a['a+1']}"
            ^
osh warning: Invalid integer constant 'a+1'
osh-byterun7 index by quoted string

[osh-byterun stdout] Expected 'c\n', got '[aa]=b\n'

stdout:
[aa]=b
stderr:
Line 3 of '<stdin>'
  echo "${a['a+1']}"
            ^
osh warning: 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 528, in <module>
    main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 501, in main
    sys.exit(AppBundleMain(argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 475, in AppBundleMain
    status = OshMain(argv0, main_argv, login_shell)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 279, 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 106, in Batch
    is_control_flow, is_fatal = ex.ExecuteAndCatch(node)
  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 685, in _Dispatch
    argv = self.word_ev.EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/core/word_eval.py", line 1069, in EvalWordSequence
    return self._EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/core/word_eval.py", line 1042, in _EvalWordSequence
    self._EvalWordToParts(w, False, part_vals)  # not double quoted
  File "/home/andy/git/oilshell/oil/core/word_eval.py", line 837, in _EvalWordToParts
    self._EvalWordPart(p, part_vals, quoted=quoted)
  File "/home/andy/git/oilshell/oil/core/word_eval.py", line 765, in _EvalWordPart
    self._EvalDoubleQuotedPart(part, part_vals)
  File "/home/andy/git/oilshell/oil/core/word_eval.py", line 418, in _EvalDoubleQuotedPart
    self._EvalWordPart(p, part_vals, quoted=True)
  File "/home/andy/git/oilshell/oil/core/word_eval.py", line 800, in _EvalWordPart
    self._EvalBracedVarSub(part, part_vals, quoted)
  File "/home/andy/git/oilshell/oil/core/word_eval.py", line 530, in _EvalBracedVarSub
    index = self.arith_ev.Eval(anode)
  File "/home/andy/git/oilshell/oil/core/expr_eval.py", line 486, 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 519, in _cpython_main_hook
    main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 501, in main
    sys.exit(AppBundleMain(argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 475, in AppBundleMain
    status = OshMain(argv0, main_argv, login_shell)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 279, 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 1069, in EvalWordSequence
    return self._EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/core/word_eval.py", line 1042, in _EvalWordSequence
    self._EvalWordToParts(w, False, part_vals)  # not double quoted
  File "/home/andy/git/oilshell/oil/core/word_eval.py", line 837, in _EvalWordToParts
    self._EvalWordPart(p, part_vals, quoted=quoted)
  File "/home/andy/git/oilshell/oil/core/word_eval.py", line 823, in _EvalWordPart
    part_vals.append(runtime.StringPartValue(')', True))  # closing )
  File "/home/andy/git/oilshell/oil/core/word_eval.py", line 418, in _EvalDoubleQuotedPart
    self._EvalWordPart(p, part_vals, quoted=True)
  File "/home/andy/git/oilshell/oil/core/word_eval.py", line 800, in _EvalWordPart
    self._EvalBracedVarSub(part, part_vals, quoted)
  File "/home/andy/git/oilshell/oil/core/word_eval.py", line 530, in _EvalBracedVarSub
    index = self.arith_ev.Eval(anode)
  File "/home/andy/git/oilshell/oil/core/expr_eval.py", line 486, 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.pre8/_bin/osh' (1)
Stripping the oil.ovm binary may cause this error.
See https://github.com/oilshell/oil/issues/47
osh-byterun8 index by unquoted string

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

stdout:
stderr: 
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 486, 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: can only concatenate list (not "int") to list
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:
osh-byterun9 index by unquoted string as arithmetic

[osh-byterun 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 '[xx]=bb [xx]=bb\n'

stdout:
[xx]=bb [xx]=bb
stderr:
Line 3 of '<stdin>'
  echo "${a[xx]}" "${a[cc]}"
            ^~
osh warning: Coercing undefined value to 0 in arithmetic context
Line 3 of '<stdin>'
  echo "${a[xx]}" "${a[cc]}"
                       ^~
osh warning: Coercing undefined value to 0 in arithmetic context
osh_ALT10 WTF index by key name

[osh_ALT stdout] Expected u'bb dd\n', got '[xx]=bb [xx]=bb\n'

stdout:
[xx]=bb [xx]=bb
stderr:
Line 3 of '<stdin>'
  echo "${a[xx]}" "${a[cc]}"
            ^~
osh warning: Coercing undefined value to 0 in arithmetic context
Line 3 of '<stdin>'
  echo "${a[xx]}" "${a[cc]}"
                       ^~
osh warning: Coercing undefined value to 0 in arithmetic context
osh-byterun10 WTF index by key name

[osh-byterun stdout] Expected u'bb dd\n', got '[xx]=bb [xx]=bb\n'

stdout:
[xx]=bb [xx]=bb
stderr:
Line 3 of '<stdin>'
  echo "${a[xx]}" "${a[cc]}"
            ^~
osh warning: Coercing undefined value to 0 in arithmetic context
Line 3 of '<stdin>'
  echo "${a[xx]}" "${a[cc]}"
                       ^~
osh warning: Coercing undefined value to 0 in arithmetic context
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: 
osh-byterun12 Can't initialize assoc array with indexed array

[osh-byterun 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: 
Line 1 of '<stdin>'
  declare -A a
  ^~~~~~~
osh warning: Invalid integer constant 'x'
Line 1 of '<stdin>'
  declare -A a
  ^~~~~~~
osh warning: Invalid integer constant 'x'
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 528, in <module>
    main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 501, in main
    sys.exit(AppBundleMain(argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 475, in AppBundleMain
    status = OshMain(argv0, main_argv, login_shell)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 279, 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 106, in Batch
    is_control_flow, is_fatal = ex.ExecuteAndCatch(node)
  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 774, in _Dispatch
    self.mem, self.exec_opts)
  File "/home/andy/git/oilshell/oil/core/expr_eval.py", line 216, in EvalLhsAndLookup
    raise NotImplementedError
NotImplementedError
osh_ALT14 Append to associative array value

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

stdout:
stderr: 
Line 1 of '<stdin>'
  declare -A a
  ^~~~~~~
osh warning: Invalid integer constant 'x'
Line 1 of '<stdin>'
  declare -A a
  ^~~~~~~
osh warning: Invalid integer constant 'x'
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 519, in _cpython_main_hook
    main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 501, in main
    sys.exit(AppBundleMain(argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 475, in AppBundleMain
    status = OshMain(argv0, main_argv, login_shell)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 279, 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/expr_eval.py", line 216, in EvalLhsAndLookup
    raise NotImplementedError
NotImplementedError
FATAL: couldn't import from app bundle '_tmp/oil-tar-test/oil-0.6.pre8/_bin/osh' (1)
Stripping the oil.ovm binary may cause this error.
See https://github.com/oilshell/oil/issues/47
osh-byterun14 Append to associative array value

[osh-byterun stdout] Expected "['foobar']\n", got ''
[osh-byterun status] Expected 0, got 1

stdout:
stderr: 
Line 1 of '<stdin>'
  declare -A a
  ^~~~~~~
osh warning: Invalid integer constant 'x'
Line 1 of '<stdin>'
  declare -A a
  ^~~~~~~
osh warning: Invalid integer constant 'x'
FATAL: