Results for assoc.test.sh

statusoshosh_.pyosh_.cc
pass 301811
ok 221
N-I 111
FAIL 41624
total373737
caseoshosh_.pyosh_.ccdescription
0pass pass pass Literal syntax ([x]=y)
1pass FAIL FAIL set associative array to indexed array literal (very surprising bash behavior)
detailsdetails
2pass pass FAIL Can't initialize assoc array with indexed array
details
3pass FAIL FAIL Initializing indexed array with assoc array
detailsdetails
4pass FAIL FAIL create empty assoc array, put, then get
detailsdetails
5pass FAIL FAIL Empty value (doesn't use EmptyWord?)
detailsdetails
6pass FAIL FAIL retrieve keys with !
detailsdetails
7pass FAIL FAIL retrieve values with ${A[@]}
detailsdetails
8FAIL FAIL FAIL coerce to string with ${A[*]}, etc.
detailsdetailsdetails
9pass FAIL FAIL ${A[@]/b/B}
detailsdetails
10pass FAIL FAIL ${A[@]#prefix}
detailsdetails
11ok ok ok ${assoc} disallowed in OSH, like ${assoc[0]} in bash
detailsdetailsdetails
12pass pass FAIL length ${#a[@]}
details
13pass pass pass lookup with ${a[0]} -- "0" is a string
14pass pass pass lookup with double quoted strings "mykey"
15pass pass pass lookup with single quoted string
16pass pass pass lookup with unquoted $key and quoted "$i$i"
17pass pass pass lookup by unquoted string doesn't work in OSH because it's a variable
18pass pass FAIL bash bug: "i+1" and i+1 are the same key
details
19pass FAIL FAIL Array stored in associative array gets converted to string (without strict_array)
detailsdetails
20pass FAIL FAIL Indexed array as key of associative array coerces to string (without shopt -s strict_array)
detailsdetails
21pass FAIL FAIL Append to associative array value A['x']+='suffix'
detailsdetails
22pass pass pass Slice of associative array doesn't make sense in bash
23N-I N-I N-I bash variable can have an associative array part and a string part
detailsdetailsdetails
24pass pass pass Associative array expressions inside (( )) with keys that look like numbers
25pass pass FAIL (( A[5] += 42 ))
details
26pass pass FAIL (( A[5] += 42 )) with empty cell
details
27pass pass pass setting key to itself (from bash-bug mailing list)
28ok ok FAIL readonly associative array can't be modified
detailsdetailsdetails
29pass pass FAIL associative array and brace expansion
details
30pass pass pass bash mangles array #1
31pass pass pass bash mangles array and brace #2
32pass pass FAIL declare -A A=() alowed
details
33pass FAIL FAIL unset -v and assoc array
detailsdetails
34FAIL FAIL FAIL nameref and assoc array
detailsdetailsdetails
35FAIL FAIL FAIL ${!ref} and assoc array
detailsdetailsdetails
36FAIL FAIL FAIL printf -v and assoc array
detailsdetailsdetails
59 passed, 5 OK, 3 not implemented, 0 BUG, 44 failed, 0 timeouts, 0 cases skipped
4 failed under osh

Details on runs that didn't PASS

osh_.py1 set associative array to indexed array literal (very surprising bash behavior)

[osh_.py stdout] Expected "foo\nspam eggs\nk1\nk2\n['foo', 'spam eggs']\n['0', '1']\n", got "(cmd_value.Argv argv:[argv.py foo 'spam eggs'] arg_spids:[87 89 89])\n(cmd_value.Argv argv:[argv.py 0 1] arg_spids:[98 100 100])\n"

stdout:
(cmd_value.Argv argv:[argv.py foo 'spam eggs'] arg_spids:[87 89 89])
(cmd_value.Argv argv:[argv.py 0 1] arg_spids:[98 100 100])
stderr:
Unhandled SimpleCommand
Unhandled SimpleCommand
osh_.cc1 set associative array to indexed array literal (very surprising bash behavior)

[osh_.cc stdout] Expected "foo\nspam eggs\nk1\nk2\n['foo', 'spam eggs']\n['0', '1']\n", got "(cmd_value.Argv argv:[argv.py foo 'spam eggs'] arg_spids:[87 89 89])\n(cmd_value.Argv argv:[argv.py 0 1] arg_spids:[98 100 100])\n"

stdout:
(cmd_value.Argv argv:[argv.py foo 'spam eggs'] arg_spids:[87 89 89])
(cmd_value.Argv argv:[argv.py 0 1] arg_spids:[98 100 100])
stderr:
Unhandled SimpleCommand
Unhandled SimpleCommand
osh_.cc2 Can't initialize assoc array with indexed array

[osh_.cc stdout] Expected 'status=2\n', got 'status=0\n'

stdout:
status=0
stderr:
osh_.py3 Initializing indexed array with assoc array

[osh_.py stdout] Expected 'status=2\n[]\n', got 'status=2\n(cmd_value.Argv argv:[argv.py] arg_spids:[27])\n'

stdout:
status=2
(cmd_value.Argv argv:[argv.py] arg_spids:[27])
stderr:
  declare -a a=([xx]=1 [yy]=2 [zz]=3)
             ^~
[ stdin ]:1: 'declare' Got -a but RHS isn't an array
Unhandled SimpleCommand
osh_.cc3 Initializing indexed array with assoc array

[osh_.cc stdout] Expected 'status=2\n[]\n', got 'status=2\n(cmd_value.Argv argv:[argv.py] arg_spids:[27])\n'

stdout:
status=2
(cmd_value.Argv argv:[argv.py] arg_spids:[27])
stderr:
  declare -a a=([xx]=1 [yy]=2 [zz]=3)
             ^~
[ stdin ]:1: 'declare' Got -a but RHS isn't an array
Unhandled SimpleCommand
osh_.py4 create empty assoc array, put, then get

[osh_.py stdout] Expected '[]\n[]\nbar\n', got '(cmd_value.Argv argv:[argv.py] arg_spids:[9])\n(cmd_value.Argv argv:[argv.py] arg_spids:[20])\nbar\n'

stdout:
(cmd_value.Argv argv:[argv.py] arg_spids:[9])
(cmd_value.Argv argv:[argv.py] arg_spids:[20])
bar
stderr:
Unhandled SimpleCommand
Unhandled SimpleCommand
osh_.cc4 create empty assoc array, put, then get

[osh_.cc stdout] Expected '[]\n[]\nbar\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: mycpp/mylib.h:626: List<V> *Dict<Str *, Str *>::values() [K = Str *, V = Str *]: Assertion `0' failed.
osh_.py5 Empty value (doesn't use EmptyWord?)

[osh_.py stdout] Expected "['']\n", got "(cmd_value.Argv argv:[argv.py ''] arg_spids:[14 16])\n"

stdout:
(cmd_value.Argv argv:[argv.py ''] arg_spids:[14 16])
stderr:
Unhandled SimpleCommand
osh_.cc5 Empty value (doesn't use EmptyWord?)

[osh_.cc stdout] Expected "['']\n", got "(cmd_value.Argv argv:[argv.py ''] arg_spids:[14 16])\n"

stdout:
(cmd_value.Argv argv:[argv.py ''] arg_spids:[14 16])
stderr:
Unhandled SimpleCommand
osh_.py6 retrieve keys with !

[osh_.py stdout] Expected 'a+1\nfoo\nx\n', got ''

stdout:
stderr: 
osh_.cc6 retrieve keys with !

[osh_.cc stdout] Expected 'a+1\nfoo\nx\n', got ''

stdout:
stderr: 
osh_.py7 retrieve values with ${A[@]}

[osh_.py stdout] Expected 'b\nbar\nc\n', got ''

stdout:
stderr: 
osh_.cc7 retrieve values with ${A[@]}

[osh_.cc stdout] Expected 'b\nbar\nc\n', got ''

stdout:
stderr: 
osh8 coerce to string with ${A[*]}, etc.

[osh stdout] Expected "['xx yy']\n['X X Y Y']\n['xx', 'yy']\n['X', 'X', 'Y', 'Y']\n", got "['xx', 'yy']\n['X X Y Y']\n['xx', 'yy']\n['X', 'X', 'Y', 'Y']\n"

stdout:
['xx', 'yy']
['X X Y Y']
['xx', 'yy']
['X', 'X', 'Y', 'Y']
stderr:
osh_.py8 coerce to string with ${A[*]}, etc.

[osh_.py stdout] Expected "['xx yy']\n['X X Y Y']\n['xx', 'yy']\n['X', 'X', 'Y', 'Y']\n", got "(cmd_value.Argv argv:[argv.py xx yy] arg_spids:[28 30 30])\n(cmd_value.Argv argv:[argv.py 'X X Y Y'] arg_spids:[39 41])\n(cmd_value.Argv argv:[argv.py xx yy] arg_spids:[51 53 53])\n(cmd_value.Argv argv:[argv.py X X Y Y] arg_spids:[60 62 62 62 62])\n"

stdout:
(cmd_value.Argv argv:[argv.py xx yy] arg_spids:[28 30 30])
(cmd_value.Argv argv:[argv.py 'X X Y Y'] arg_spids:[39 41])
(cmd_value.Argv argv:[argv.py xx yy] arg_spids:[51 53 53])
(cmd_value.Argv argv:[argv.py X X Y Y] arg_spids:[60 62 62 62 62])
stderr:
Unhandled SimpleCommand
Unhandled SimpleCommand
Unhandled SimpleCommand
Unhandled SimpleCommand
osh_.cc8 coerce to string with ${A[*]}, etc.

[osh_.cc stdout] Expected "['xx yy']\n['X X Y Y']\n['xx', 'yy']\n['X', 'X', 'Y', 'Y']\n", got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: mycpp/mylib.h:626: List<V> *Dict<Str *, Str *>::values() [K = Str *, V = Str *]: Assertion `0' failed.
osh_.py9 ${A[@]/b/B}

[osh_.py stdout] Expected 'BBB\nccc\nddd\n', got ''

stdout:
stderr: 
osh_.cc9 ${A[@]/b/B}

[osh_.cc stdout] Expected 'BBB\nccc\nddd\n', got ''

stdout:
stderr: 
osh_.py10 ${A[@]#prefix}

[osh_.py stdout] Expected 'hree\none\nwo\n', got ''

stdout:
stderr: 
osh_.cc10 ${A[@]#prefix}

[osh_.cc stdout] Expected 'hree\none\nwo\n', got ''

stdout:
stderr: 
osh11 ${assoc} disallowed in OSH, like ${assoc[0]} in bash

stdout:
stderr: 
  echo "${a}"
        ^~
[ stdin ]:3: fatal: Array 'a' can't be referred to as a scalar (without @ or *)
osh_.py11 ${assoc} disallowed in OSH, like ${assoc[0]} in bash

stdout:
stderr: 
  echo "${a}"
        ^~
[ stdin ]:3: fatal: Array 'a' can't be referred to as a scalar (without @ or *)
osh_.cc11 ${assoc} disallowed in OSH, like ${assoc[0]} in bash

stdout:
stderr: 
  echo "${a}"
  ^~~~
[ stdin ]:3: fatal: Array 'a' can't be referred to as a scalar (without @ or *)
osh_.cc12 length ${#a[@]}

[osh_.cc stdout] Expected '3\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: mycpp/mylib.h:721: int len(const Dict<K, V> *) [K = Str *, V = Str *]: Assertion `0' failed.
osh_.cc18 bash bug: "i+1" and i+1 are the same key

[osh_.cc stdout] Expected 'array[i]=6\narray[i+1]=7\n', got ''
[osh_.cc status] Expected 1, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/libc.h:37: List<Str *> *libc::glob(Str *): Assertion `0' failed.
osh_.py19 Array stored in associative array gets converted to string (without strict_array)

[osh_.py stdout] Expected "['1 2 3']\n", got "(cmd_value.Argv argv:[argv.py '1 2 3'] arg_spids:[33 35])\n"

stdout:
(cmd_value.Argv argv:[argv.py '1 2 3'] arg_spids:[33 35])
stderr:
Unhandled SimpleCommand
osh_.cc19 Array stored in associative array gets converted to string (without strict_array)

[osh_.cc stdout] Expected "['1 2 3']\n", got "(cmd_value.Argv argv:[argv.py '1 2 3'] arg_spids:[33 35])\n"

stdout:
(cmd_value.Argv argv:[argv.py '1 2 3'] arg_spids:[33 35])
stderr:
Unhandled SimpleCommand
osh_.py20 Indexed array as key of associative array coerces to string (without shopt -s strict_array)

[osh_.py stdout] Expected 'foo\n1 2 3\n42\n', got 'foo\n'

stdout:
foo
stderr:
osh_.cc20 Indexed array as key of associative array coerces to string (without shopt -s strict_array)

[osh_.cc stdout] Expected 'foo\n1 2 3\n42\n', got 'foo\n'

stdout:
foo
stderr:
osh_.py21 Append to associative array value A['x']+='suffix'

[osh_.py stdout] Expected "['foobarbar']\n", got '(cmd_value.Argv argv:[argv.py foobarbar] arg_spids:[45 47])\n'

stdout:
(cmd_value.Argv argv:[argv.py foobarbar] arg_spids:[45 47])
stderr:
Unhandled SimpleCommand
osh_.cc21 Append to associative array value A['x']+='suffix'

[osh_.cc stdout] Expected "['foobarbar']\n", got ''
[osh_.cc status] Expected 0, got -11

stdout:
stderr: 
osh23 bash variable can have an associative array part and a string part

stdout:
stderr: 
  echo ${assoc[1]} ${assoc[2]} ${assoc}
                               ^~
[ stdin ]:4: fatal: Array 'assoc' can't be referred to as a scalar (without @ or *)
osh_.py23 bash variable can have an associative array part and a string part

stdout:
stderr: 
  echo ${assoc[1]} ${assoc[2]} ${assoc}
                               ^~
[ stdin ]:4: fatal: Array 'assoc' can't be referred to as a scalar (without @ or *)
osh_.cc23 bash variable can have an associative array part and a string part

stdout:
stderr: 
  assoc[2]=2
        ^
[ array LValue in TODO ]:3: fatal: Array 'assoc' can't be referred to as a scalar (without @ or *)
osh_.cc25 (( A[5] += 42 ))

[osh_.cc stdout] Expected '16\n', got ''
[osh_.cc status] Expected 0, got -11

stdout:
stderr: 
osh_.cc26 (( A[5] += 42 )) with empty cell

[osh_.cc stdout] Expected '6\n', got ''
[osh_.cc status] Expected 0, got -11

stdout:
stderr: 
osh28 readonly associative array can't be modified

stdout:
stderr: 
  A['x']=1
  ^~
[ stdin ]:2: fatal: Can't assign to readonly associative array
osh_.py28 readonly associative array can't be modified

stdout:
stderr: 
  A['x']=1
  ^~
[ stdin ]:2: fatal: Can't assign to readonly associative array
osh_.cc28 readonly associative array can't be modified

[osh_.cc stdout] Expected u'', got 'status=0\n'
[osh_.cc status] Expected 1, got 0

stdout:
status=0
stderr:
osh_.cc29 associative array and brace expansion

[osh_.cc stdout] Expected 'v\n-{a,b}-\n', got '\n\n'

stdout:

stderr:
osh_.cc32 declare -A A=() alowed

[osh_.cc stdout] Expected 'len=0\nlen=1\nunset len=0\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: mycpp/mylib.h:721: int len(const Dict<K, V> *) [K = Str *, V = Str *]: Assertion `0' failed.
osh_.py33 unset -v and assoc array

[osh_.py stdout] Expected 'len=1\nlen=0\nlen=1\nlen=0\nlen=1\nlen=0\n', got '(cmd_value.Argv argv:[show-len] arg_spids:[44])\n(cmd_value.Argv argv:[show-len] arg_spids:[61])\n(cmd_value.Argv argv:[show-len] arg_spids:[77])\n(cmd_value.Argv argv:[show-len] arg_spids:[95])\n(cmd_value.Argv argv:[show-len] arg_spids:[111])\n'
[osh_.py status] Expected 0, got 1
[osh_.py stderr] Found 'Traceback (most recent'

stdout:
(cmd_value.Argv argv:[show-len] arg_spids:[44])
(cmd_value.Argv argv:[show-len] arg_spids:[61])
(cmd_value.Argv argv:[show-len] arg_spids:[77])
(cmd_value.Argv argv:[show-len] arg_spids:[95])
(cmd_value.Argv argv:[show-len] arg_spids:[111])
stderr:
Unhandled SimpleCommand
Unhandled SimpleCommand
Unhandled SimpleCommand
Unhandled SimpleCommand
Unhandled SimpleCommand
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 341, in <module>
    status = main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 228, in main
    status = main_loop.Batch(cmd_ev, c_parser, arena, is_main=True)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 165, in Batch
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, optimize=optimize)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1450, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1334, in _Execute
    status, check_errexit = self._Dispatch(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 573, in _Dispatch
    status = self._RunSimpleCommand(cmd_val, node.do_fork)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 481, in _RunSimpleCommand
    return self.shell_ex.RunSimpleCommand(cmd_val, do_fork)
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 317, in RunSimpleCommand
    return self.RunBuiltin(builtin_id, cmd_val)
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 305, in RunBuiltin
    status = builtin_func.Run(cmd_val)
  File "/home/andy/git/oilshell/oil/osh/builtin_assign.py", line 466, in Run
    if not self._UnsetVar(name, spid, False):
  File "/home/andy/git/oilshell/oil/osh/builtin_assign.py", line 424, in _UnsetVar
    lval = self.arith_ev.EvalArithLhs(anode, spid)
  File "/home/andy/git/oilshell/oil/osh/sh_expr_eval.py", line 759, in EvalArithLhs
    key = self.EvalWordToString(anode.right)
  File "/home/andy/git/oilshell/oil/osh/sh_expr_eval.py", line 683, in EvalWordToString
    val = self.word_ev.EvalWordToString(w)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1484, in EvalWordToString
    self._EvalWordPart(p, part_vals, quoted=False)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1318, in _EvalWordPart
    sv = self._EvalCommandSub(part.child, quoted) # type: part_value_t
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1945, in _EvalCommandSub
    stdout = self.shell_ex.RunCommandSub(node)
AttributeError: 'NoneType' object has no attribute 'RunCommandSub'
osh_.cc33 unset -v and assoc array

[osh_.cc stdout] Expected 'len=1\nlen=0\nlen=1\nlen=0\nlen=1\nlen=0\n', got '(cmd_value.Argv argv:[show-len] arg_spids:[44])\n'
[osh_.cc status] Expected 0, got -6

stdout:
(cmd_value.Argv argv:[show-len] arg_spids:[44])
stderr:
Unhandled SimpleCommand
osh_eval.dbg: mycpp/mylib.h:617: void Dict<Str *, Str *>::remove(K) [K = Str *, V = Str *]: Assertion `0' failed.
osh34 nameref and assoc array

[osh stdout] Expected 'values: val\nbefore val\nafter val2\nvalues: val2\n---\nbefore val2\nafter val3\nvalues: val3\n', got 'values: val\nbefore A["K"]\nafter val2\nvalues: val\n---\nbefore A[$key]\nafter val3\nvalues: val\n'

stdout:
values: val
before A["K"]
after val2
values: val
---
before A[$key]
after val3
values: val
stderr:
osh_.py34 nameref and assoc array

[osh_.py stdout] Expected 'values: val\nbefore val\nafter val2\nvalues: val2\n---\nbefore val2\nafter val3\nvalues: val3\n', got '(cmd_value.Argv argv:[show-values] arg_spids:[35])\n'
[osh_.py status] Expected 0, got 1
[osh_.py stderr] Found 'Traceback (most recent'

stdout:
(cmd_value.Argv argv:[show-values] arg_spids:[35])
stderr:
Unhandled SimpleCommand
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 341, in <module>
    status = main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 228, in main
    status = main_loop.Batch(cmd_ev, c_parser, arena, is_main=True)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 165, in Batch
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, optimize=optimize)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1450, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1334, in _Execute
    status, check_errexit = self._Dispatch(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 538, in _Dispatch
    cmd_val = self.word_ev.EvalWordSequence2(words, allow_assign=True)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1854, in EvalWordSequence2
    self._EvalWordToParts(w, False, part_vals)  # not double quoted
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1441, in _EvalWordToParts
    self._EvalWordPart(p, part_vals, quoted=quoted, is_subst=is_subst)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1330, in _EvalWordPart
    self._EvalSimpleVarSub(part.token, part_vals, quoted)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1231, in _EvalSimpleVarSub
    val = self.mem.GetVar(var_name)
  File "/home/andy/git/oilshell/oil/core/state.py", line 1417, in GetVar
    cell, _, _ = self._ResolveNameOrRef(name, lookup_mode)
  File "/home/andy/git/oilshell/oil/core/state.py", line 1048, in _ResolveNameOrRef
    if self.exec_opts.strict_nameref():
AttributeError: 'NoneType' object has no attribute 'strict_nameref'
osh_.cc34 nameref and assoc array

[osh_.cc stdout] Expected 'values: val\nbefore val\nafter val2\nvalues: val2\n---\nbefore val2\nafter val3\nvalues: val3\n', got '(cmd_value.Argv argv:[show-values] arg_spids:[35])\n'
[osh_.cc status] Expected 0, got -6

stdout:
(cmd_value.Argv argv:[show-values] arg_spids:[35])
stderr:
Unhandled SimpleCommand
osh_eval.dbg: cpp/libc.h:37: List<Str *> *libc::glob(Str *): Assertion `0' failed.
osh35 ${!ref} and assoc array

[osh stdout] Expected 'values: val\nref val\nref val\n', got 'values: val\nref\nref\n'

stdout:
values: val
ref
ref
stderr:
osh_.py35 ${!ref} and assoc array

[osh_.py stdout] Expected 'values: val\nref val\nref val\n', got '(cmd_value.Argv argv:[show-values] arg_spids:[35])\nref\nref\n'

stdout:
(cmd_value.Argv argv:[show-values] arg_spids:[35])
ref
ref
stderr:
Unhandled SimpleCommand
osh_.cc35 ${!ref} and assoc array

[osh_.cc stdout] Expected 'values: val\nref val\nref val\n', got '(cmd_value.Argv argv:[show-values] arg_spids:[35])\n'
[osh_.cc status] Expected 0, got -6

stdout:
(cmd_value.Argv argv:[show-values] arg_spids:[35])
stderr:
Unhandled SimpleCommand
osh_eval.dbg: mycpp/mylib.h:578: V Dict<Str *, Str *>::index(K) [K = Str *, V = Str *]: Assertion `0' failed.
osh36 printf -v and assoc array

[osh stdout] Expected 'values: val\nvalues: /val2/\nvalues: /val3/\n', got 'values: val\nvalues: val\nvalues: val\n'

stdout:
values: val
values: val
values: val
stderr:
  printf -v 'assoc["K"]' '/%s/' val2
  ^~~~~~
[ stdin ]:6: 'printf' got invalid variable name 'assoc["K"]'
  printf -v 'assoc[$key]' '/%s/' val3
  ^~~~~~
[ stdin ]:9: 'printf' got invalid variable name 'assoc[$key]'
osh_.py36 printf -v and assoc array

[osh_.py stdout] Expected 'values: val\nvalues: /val2/\nvalues: /val3/\n', got '(cmd_value.Argv argv:[show-values] arg_spids:[35])\n'
[osh_.py status] Expected 0, got 1
[osh_.py stderr] Found 'Traceback (most recent'

stdout:
(cmd_value.Argv argv:[show-values] arg_spids:[35])
stderr:
Unhandled SimpleCommand
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 341, in <module>
    status = main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 228, in main
    status = main_loop.Batch(cmd_ev, c_parser, arena, is_main=True)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 165, in Batch
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, optimize=optimize)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1450, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1334, in _Execute
    status, check_errexit = self._Dispatch(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 573, in _Dispatch
    status = self._RunSimpleCommand(cmd_val, node.do_fork)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 481, in _RunSimpleCommand
    return self.shell_ex.RunSimpleCommand(cmd_val, do_fork)
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 321, in RunSimpleCommand
    return self.RunBuiltin(builtin_id, cmd_val)
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 302, in RunBuiltin
    builtin_func = self.builtins[builtin_id]
KeyError: 22
osh_.cc36 printf -v and assoc array

[osh_.cc stdout] Expected 'values: val\nvalues: /val2/\nvalues: /val3/\n', got '(cmd_value.Argv argv:[show-values] arg_spids:[35])\n'
[osh_.cc status] Expected 0, got -6

stdout:
(cmd_value.Argv argv:[show-values] arg_spids:[35])
stderr:
Unhandled SimpleCommand
osh_eval.dbg: mycpp/mylib.h:578: V Dict<int, vm::_Builtin *>::index(K) [K = int, V = vm::_Builtin *]: Assertion `0' failed.