Results for var-ref.test.sh

statusoshosh-cpp
pass 3030
FAIL 11
total3131
caseoshosh-cppdescription
0pass pass var ref ${!a}
1pass pass ${!ref-default}
2pass pass ${!undef:-}
3pass pass comparison to ${!array[@]} keys (similar SYNTAX)
4pass pass ${!a[@]-'default'} is legal but fails with more than one element
5pass pass var ref to $@ with @
6pass pass var ref to $1 and $2 with 1 and 2
7pass pass var ref: 1, @, *
8pass pass var ref to special var BASH_SOURCE
9pass pass var ref to $? with '?'
10pass pass Var ref, then assignment with ${ := }
11pass pass Var ref, then error with ${ ? }
12pass pass Indirect expansion, THEN suffix operators
13pass pass var ref OF array var -- silent a[0] decay
14pass pass array ref
15pass pass array ref with strict_array
16pass pass var ref TO array var
17pass pass var ref TO array var, with subscripts
18pass pass var ref TO assoc array a[key]
19pass pass var ref TO array with arbitrary subscripts
20pass pass Bizarre tilde expansion in array index
21pass pass Indirect expansion TO fancy expansion features bash disallows
22pass pass Bad var ref
23pass pass Bad var ref 2
24pass pass ${!OPTIND} (used by bash completion
25pass pass var ref doesn't need cycle detection
26pass pass Var Ref Code Injection $(tee PWNED)
27pass pass ${!array_ref:-set} and ${!array_ref:=assign}
28pass pass Array indirect expansion with suffix operators
29pass pass Array indirect expansion with replacements
30FAIL FAIL Array indirect expansion with @? conversion
detailsdetails
60 passed, 0 OK, 0 not implemented, 0 BUG, 1 failed, 0 timeouts, 0 cases skipped
1 failed under osh

Details on runs that didn't PASS

osh30 Array indirect expansion with @? conversion

[osh stdout] Expected '==== v1 ====\n[\'value\']\n[\'value\']\n[\'\']\n==== v2 ====\n["\'\'"]\n[\'\']\n[\'\']\n==== a1 ====\n[\'\']\n[\'\']\n[\'a\']\n==== a2[0] ====\n[\'element\']\n[\'element\']\n[\'a\']\n==== a3[@] ====\n[\'1\', \'2\', \'3\']\n[\'1\', \'2\', \'3\']\n[\'a\', \'a\', \'a\']\n' Got '==== v1 ====\n[\'value\']\n[\'value\']\n[\'\']\n==== v2 ====\n["\'\'"]\n[\'\']\n[\'\']\n==== a1 ====\n[\'\']\n[\'\']\n[\'a\']\n==== a2[0] ====\n[\'element\']\n[\'element\']\n[\'\']\n==== a3[@] ====\n[\'1 2 3\']\n'
[osh status] Expected 0, got 1

stdout:
==== v1 ====
['value']
['value']
['']
==== v2 ====
["''"]
['']
['']
==== a1 ====
['']
['']
['a']
==== a2[0] ====
['element']
['element']
['']
==== a3[@] ====
['1 2 3']
stderr:
    argv.py "${!ref[@]@P}"
                      ^~
[ stdin ]:6: fatal: Can't use @P on BashArray
osh-cpp30 Array indirect expansion with @? conversion

[osh-cpp stdout] Expected '==== v1 ====\n[\'value\']\n[\'value\']\n[\'\']\n==== v2 ====\n["\'\'"]\n[\'\']\n[\'\']\n==== a1 ====\n[\'\']\n[\'\']\n[\'a\']\n==== a2[0] ====\n[\'element\']\n[\'element\']\n[\'a\']\n==== a3[@] ====\n[\'1\', \'2\', \'3\']\n[\'1\', \'2\', \'3\']\n[\'a\', \'a\', \'a\']\n' Got '==== v1 ====\n[\'value\']\n[\'value\']\n[\'\']\n==== v2 ====\n["\'\'"]\n[\'\']\n[\'\']\n==== a1 ====\n[\'\']\n[\'\']\n[\'a\']\n==== a2[0] ====\n[\'element\']\n[\'element\']\n[\'\']\n==== a3[@] ====\n[\'1 2 3\']\n'
[osh-cpp status] Expected 0, got 1

stdout:
==== v1 ====
['value']
['value']
['']
==== v2 ====
["''"]
['']
['']
==== a1 ====
['']
['']
['a']
==== a2[0] ====
['element']
['element']
['']
==== a3[@] ====
['1 2 3']
stderr:
    argv.py "${!ref[@]@P}"
                      ^~
[ stdin ]:6: fatal: Can't use @P on BashArray