Results for var-ref.test.sh

statusbashoshosh_ALT
pass 212525
ok 222
N-I 100
BUG 300
total272727
casebashoshosh_ALTdescription
0pass pass pass var ref ${!a}
1pass pass pass ${!ref-default}
2pass pass pass ${!undef:-}
3pass pass pass comparison to ${!array[@]} keys (similar SYNTAX)
4BUG pass pass ${!a[@]-'default'} is illegal
details
5pass pass pass var ref to $@ with @
6pass pass pass var ref to $1 and $2 with 1 and 2
7pass pass pass var ref: 1, @, *
8pass pass pass var ref to special var BASH_SOURCE
9pass pass pass var ref to $? with '?'
10pass pass pass Var ref, then assignment with ${ := }
11pass pass pass Var ref, then error with ${ ? }
12pass pass pass Indirect expansion, THEN suffix operators
13pass pass pass var ref OF array var -- silent a[0] decay
14pass pass pass array ref
15N-I pass pass array ref with strict_array
details
16pass pass pass var ref TO array var
17pass pass pass var ref TO array var, with subscripts
18pass pass pass var ref TO assoc array a[key]
19pass pass pass var ref TO array with arbitrary subscripts
20BUG pass pass Bizarre tilde expansion in array index
details
21ok pass pass Indirect expansion TO fancy expansion features bash disallows
details
22pass ok ok Bad var ref
detailsdetails
23pass ok ok Bad var ref 2
detailsdetails
24pass pass pass ${!OPTIND} (used by bash completion
25ok pass pass var ref doesn't need cycle detection
details
26BUG pass pass Var Ref Code Injection $(tee PWNED)
details
71 passed, 6 OK, 1 not implemented, 3 BUG, 0 failed, 0 timeouts, 0 cases skipped

Details on runs that didn't PASS

bash4 ${!a[@]-'default'} is illegal

stdout:
['default']
status=0
status=1
stderr:
bash: line 5: x y z: bad substitution
bash15 array ref with strict_array

stdout:
ale
stderr:
bash: line 1: shopt: strict_array: invalid shell option name
bash20 Bizarre tilde expansion in array index

stdout:
y
stderr:
bash21 Indirect expansion TO fancy expansion features bash disallows

stdout:
done
stderr:
main: line 2: a[0: bad substitution
main: line 2: aa[k: bad substitution
main: line 2: !x: bad substitution
main: line 2: !a[0]: bad substitution
main: line 2: x:-foo: bad substitution
main: line 2: x:=foo: bad substitution
main: line 2: x:?oops: bad substitution
main: line 2: x:+yy: bad substitution
main: line 2: x:0: bad substitution
main: line 2: x:0:1: bad substitution
main: line 2: !a@: bad substitution
main: line 2: #x: bad substitution
main: line 2: x#y: bad substitution
main: line 2: x/y/foo: bad substitution
main: line 2: x@Q: bad substitution
osh22 Bad var ref

stdout:
stderr: 
  bad var name
     ^
[ contents of var 'a' at line 2 of [ stdin ] ]:1: Expected end of var ref expression
  echo ref ${!a}
              ^
[ stdin ]:2: fatal: Invalid var ref expression
osh_ALT22 Bad var ref

stdout:
stderr: 
  bad var name
     ^
[ contents of var 'a' at line 2 of [ stdin ] ]:1: Expected end of var ref expression
  echo ref ${!a}
              ^
[ stdin ]:2: fatal: Invalid var ref expression
osh23 Bad var ref 2

stdout:
stderr: 
  /
  ^
[ contents of var 'b' at line 2 of [ stdin ] ]:1: Expected var name
  echo ref ${!b}
              ^
[ stdin ]:2: fatal: Invalid var ref expression
osh_ALT23 Bad var ref 2

stdout:
stderr: 
  /
  ^
[ contents of var 'b' at line 2 of [ stdin ] ]:1: Expected var name
  echo ref ${!b}
              ^
[ stdin ]:2: fatal: Invalid var ref expression
bash25 var ref doesn't need cycle detection

stdout:
cycle=x
cycle=
stderr:
bash: line 7: warning: a: circular name reference
bash26 Var Ref Code Injection $(tee PWNED)

stdout:
42
PWNED
0
stderr: