Results for var-ref.test.sh

statusoshosh_.pyosh_.cc
pass 242419
ok 222
FAIL 005
total262626
caseoshosh_.pyosh_.ccdescription
0pass pass pass var ref ${!a}
1pass pass pass ${!ref-default}
2pass pass pass ${!undef:-}
3pass pass FAIL comparison to ${!array[@]} keys (similar SYNTAX)
details
4pass pass pass ${!a[@]-'default'} is illegal
5pass pass pass var ref to $@ with @
6pass pass pass var ref to $1 and $2 with 1 and 2
7pass pass FAIL var ref: 1, @, *
details
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 FAIL Indirect expansion, THEN suffix operators
details
13pass pass pass var ref OF array var
14pass pass pass array ref without eval_unsafe_arith
15pass pass pass array ref without compat_array
16pass pass pass var ref TO array var
17pass pass FAIL var ref TO array var, with subscripts
details
18pass pass pass var ref TO assoc array a[key]
19pass pass FAIL var ref TO array with arbitrary subscripts
details
20pass pass pass Bizarre tilde expansion in array index
21pass pass pass Indirect expansion TO fancy expansion features bash disallows
22ok ok ok Bad var ref
detailsdetailsdetails
23ok ok ok Bad var ref 2
detailsdetailsdetails
24pass pass pass ${!OPTIND} (used by bash completion
25pass pass pass var ref doesn't need cycle detection
67 passed, 6 OK, 0 not implemented, 0 BUG, 5 failed, 0 timeouts, 0 cases skipped

Details on runs that didn't PASS

osh_.cc3 comparison to ${!array[@]} keys (similar SYNTAX)

[osh_.cc stdout] Expected "['0', '1']\na_keys=0\n['']\na_nobrackets=0\n---\n['A', 'B']\nA_keys=0\n['']\nA_nobrackets=0\n", got "a_keys=-1\na_nobrackets=-1\n---\nA_keys=-1\nA_nobrackets=-1\n['0', '1']\n['']\n['']\n['A', 'B']\n"

stdout:
a_keys=-1
a_nobrackets=-1
---
A_keys=-1
A_nobrackets=-1
['0', '1']
['']
['']
['A', 'B']
stderr:
dumb_alloc:
	gNumNew = 3407
	gNumDelete = 411
	gMemPos = 109504

	gNumMalloc = 613
	gNumFree = 0
	gMemPos2 = 18432
osh_.cc7 var ref: 1, @, *

[osh_.cc stdout] Expected "['x']\n['x', 'y']\n['x y']\n", got "['x y']\n['x']\n['x', 'y']\n"
[osh_.cc status] Expected 0, got 255

stdout:
['x y']
['x']
['x', 'y']
stderr:
dumb_alloc:
	gNumNew = 2303
	gNumDelete = 209
	gMemPos = 77184

	gNumMalloc = 201
	gNumFree = 0
	gMemPos2 = 11792
osh_.cc12 Indirect expansion, THEN suffix operators

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

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:74: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc17 var ref TO array var, with subscripts

[osh_.cc stdout] Expected "['']\n['x']\n['z']\n['x', 'y', 'z']\n['x y z']\n", got "['x']\n['x y z']\n['x', 'y', 'z']\n['']\n['z']\n"
[osh_.cc status] Expected 0, got 255

stdout:
['x']
['x y z']
['x', 'y', 'z']
['']
['z']
stderr:
dumb_alloc:
	gNumNew = 2845
	gNumDelete = 289
	gMemPos = 92032

	gNumMalloc = 397
	gNumFree = 0
	gMemPos2 = 15024
osh_.cc19 var ref TO array with arbitrary subscripts

[osh_.cc stdout] Expected 'works: a[1]\nworks: a[$b]\nworks: a[${c:-1}]\nworks: a[$(echo 1)]\nworks: a[$(( 3 - 2 ))]\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:74: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh22 Bad var ref

stdout:
stderr: 
  bad var name
     ^
[ var ? ]:1: Expected end of var ref
  echo ref ${!a}
              ^
[ stdin ]:2: fatal: Invalid var ref
osh_.py22 Bad var ref

stdout:
stderr: 
  bad var name
     ^
[ var ? ]:1: Expected end of var ref
  echo ref ${!a}
              ^
[ stdin ]:2: fatal: Invalid var ref
osh_.cc22 Bad var ref

stdout:
stderr: 
  bad var name
     ^
[ var ? ]:1: Expected end of var ref
  echo ref ${!a}
  ^~~~
[ stdin ]:2: fatal: Invalid var ref

dumb_alloc:
	gNumNew = 1814
	gNumDelete = 127
	gMemPos = 62864

	gNumMalloc = 81
	gNumFree = 0
	gMemPos2 = 9872
osh23 Bad var ref 2

stdout:
stderr: 
  /
  ^
[ var ? ]:1: Invalid var ref
  echo ref ${!b}
              ^
[ stdin ]:2: fatal: Invalid var ref
osh_.py23 Bad var ref 2

stdout:
stderr: 
  /
  ^
[ var ? ]:1: Invalid var ref
  echo ref ${!b}
              ^
[ stdin ]:2: fatal: Invalid var ref
osh_.cc23 Bad var ref 2

stdout:
stderr: 
  /
  ^
[ var ? ]:1: Invalid var ref
  echo ref ${!b}
  ^~~~
[ stdin ]:2: fatal: Invalid var ref

dumb_alloc:
	gNumNew = 1811
	gNumDelete = 128
	gMemPos = 62992

	gNumMalloc = 78
	gNumFree = 0
	gMemPos2 = 9824