Results for var-ref.test.sh

statusoshosh_.pyosh_.cc
pass 242421
ok 222
FAIL 003
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 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 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 pass var ref TO array var, with subscripts
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
69 passed, 6 OK, 0 not implemented, 0 BUG, 3 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 "['0', '1']\n['']\n['A', 'B']\n['']\na_keys=0\na_nobrackets=0\n---\nA_keys=0\nA_nobrackets=0\n"

stdout:
['0', '1']
['']
['A', 'B']
['']
a_keys=0
a_nobrackets=0
---
A_keys=0
A_nobrackets=0
stderr:
dumb_alloc:
	gNumNew = 3318
	gNumDelete = 402
	gMemPos = 106416

	gNumMalloc = 602
	gNumFree = 0
	gMemPos2 = 18256
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:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
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:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh22 Bad var ref

stdout:
stderr: 
  bad var name
     ^
(source.ArgvWord word_spid:11):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
     ^
(source.ArgvWord word_spid:11):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
     ^
TODO:1: Expected end of var ref
  echo ref ${!a}
  ^~~~
[ stdin ]:2: fatal: Invalid var ref

dumb_alloc:
	gNumNew = 1777
	gNumDelete = 127
	gMemPos = 61712

	gNumMalloc = 82
	gNumFree = 0
	gMemPos2 = 9888
osh23 Bad var ref 2

stdout:
stderr: 
  /
  ^
(source.ArgvWord word_spid:14):1: Invalid var ref
  echo ref ${!b}
              ^
[ stdin ]:2: fatal: Invalid var ref
osh_.py23 Bad var ref 2

stdout:
stderr: 
  /
  ^
(source.ArgvWord word_spid:14):1: Invalid var ref
  echo ref ${!b}
              ^
[ stdin ]:2: fatal: Invalid var ref
osh_.cc23 Bad var ref 2

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

dumb_alloc:
	gNumNew = 1774
	gNumDelete = 128
	gMemPos = 61840

	gNumMalloc = 79
	gNumFree = 0
	gMemPos2 = 9840