Results for nameref.test.sh

statusoshosh_.pyosh_.cc
pass 252524
FAIL 778
total323232
caseoshosh_.pyosh_.ccdescription
0pass pass pass pass array by reference
1pass pass pass mutate array by reference
2pass pass pass pass assoc array by reference
3pass pass pass pass local array by reference, relying on DYNAMIC SCOPING
4pass pass pass flag -n and +n
5pass pass pass mutating through nameref: ref=
6FAIL FAIL FAIL flag -n combined ${!ref} -- bash INVERTS
detailsdetailsdetails
7pass pass pass named ref with $# doesn't work
8pass pass pass named ref with $# and shopt -s strict_nameref
9pass pass pass named ref with 1 $1 etc.
10pass pass pass assign to invalid ref
11pass pass pass assign to invalid ref with strict_nameref
12pass pass pass name ref on Undef cell
13pass pass pass assign to empty nameref and invalid nameref
14pass pass pass -n attribute before it has a value
15pass pass pass -n attribute on array is hard error, not a warning
16pass pass FAIL exported nameref
details
17pass pass pass readonly nameref doesn't prevent assigning through it
18pass pass pass readonly var can't be assigned through nameref
19pass pass pass unset nameref
20pass pass pass Chain of namerefs
21pass pass pass Mutually recursive namerefs detected on READ
22pass pass pass Mutually recursive namerefs detected on WRITE
23pass pass pass Dynamic scope with namerefs
24pass pass pass change reference itself
25FAIL FAIL FAIL a[2] in nameref (eval_unsafe_arith)
detailsdetailsdetails
26FAIL FAIL FAIL a[expr] in nameref (eval_unsafe_arith)
detailsdetailsdetails
27FAIL FAIL FAIL a[@] in nameref (eval_unsafe_arith)
detailsdetailsdetails
28pass pass pass mutate through nameref: ref[0]=
29FAIL FAIL FAIL bad mutation through nameref: ref[0]= where ref is array[0]
detailsdetailsdetails
30FAIL FAIL FAIL @ in nameref isn't supported, unlike in ${!ref}
detailsdetailsdetails
31FAIL FAIL FAIL Unquoted assoc reference on RHS
detailsdetailsdetails
74 passed, 0 OK, 0 not implemented, 0 BUG, 22 failed, 0 timeouts, 0 cases skipped
7 failed under osh

Details on runs that didn't PASS

osh6 flag -n combined ${!ref} -- bash INVERTS

[osh stdout] Expected 'ref=x\n!ref=foo\nNOW A NAMEREF\nref=foo\n!ref=x\n', got 'ref=x\n!ref=foo\nNOW A NAMEREF\nref=foo\n!ref=FOO\n'

stdout:
ref=x
!ref=foo
NOW A NAMEREF
ref=foo
!ref=FOO
stderr:
osh_.py6 flag -n combined ${!ref} -- bash INVERTS

[osh_.py stdout] Expected 'ref=x\n!ref=foo\nNOW A NAMEREF\nref=foo\n!ref=x\n', got 'ref=x\n!ref=foo\nNOW A NAMEREF\nref=foo\n!ref=FOO\n'

stdout:
ref=x
!ref=foo
NOW A NAMEREF
ref=foo
!ref=FOO
stderr:
osh_.cc6 flag -n combined ${!ref} -- bash INVERTS

[osh_.cc stdout] Expected 'ref=x\n!ref=foo\nNOW A NAMEREF\nref=foo\n!ref=x\n', got 'ref=x\n!ref=foo\nNOW A NAMEREF\nref=foo\n!ref=FOO\n'

stdout:
ref=x
!ref=foo
NOW A NAMEREF
ref=foo
!ref=FOO
stderr:
dumb_alloc:
	gNumNew = 2440
	gNumDelete = 247
	gMemPos = 79856

	gNumMalloc = 227
	gNumFree = 0
	gMemPos2 = 12032
osh_.cc16 exported nameref

[osh_.cc stdout] Expected 'None\nx\n---\nfoo\nx\n', got 'None\nNone\nNone\nNone\n---\n'

stdout:
None
None
None
None
---
stderr:
dumb_alloc:
	gNumNew = 2274
	gNumDelete = 224
	gMemPos = 76896

	gNumMalloc = 213
	gNumFree = 0
	gMemPos2 = 11840
osh25 a[2] in nameref (eval_unsafe_arith)

[osh stdout] Expected 'ref=two\n', got 'ref=a[2]\n'

stdout:
ref=a[2]
stderr:
osh_.py25 a[2] in nameref (eval_unsafe_arith)

[osh_.py stdout] Expected 'ref=two\n', got 'ref=a[2]\n'

stdout:
ref=a[2]
stderr:
osh_.cc25 a[2] in nameref (eval_unsafe_arith)

[osh_.cc stdout] Expected 'ref=two\n', got 'ref=a[2]\n'

stdout:
ref=a[2]
stderr:
dumb_alloc:
	gNumNew = 2279
	gNumDelete = 214
	gMemPos = 76560

	gNumMalloc = 255
	gNumFree = 0
	gMemPos2 = 12576
osh26 a[expr] in nameref (eval_unsafe_arith)

[osh stdout] Expected 'ref=three\n', got 'ref=a[$(echo 2) + 1]\n'

stdout:
ref=a[$(echo 2) + 1]
stderr:
osh_.py26 a[expr] in nameref (eval_unsafe_arith)

[osh_.py stdout] Expected 'ref=three\n', got 'ref=a[$(echo 2) + 1]\n'

stdout:
ref=a[$(echo 2) + 1]
stderr:
osh_.cc26 a[expr] in nameref (eval_unsafe_arith)

[osh_.cc stdout] Expected 'ref=three\n', got 'ref=a[$(echo 2) + 1]\n'

stdout:
ref=a[$(echo 2) + 1]
stderr:
dumb_alloc:
	gNumNew = 2338
	gNumDelete = 232
	gMemPos = 78432

	gNumMalloc = 291
	gNumFree = 0
	gMemPos2 = 13216
osh27 a[@] in nameref (eval_unsafe_arith)

[osh stdout] Expected "['ref', 'A B C']\nstatus=1\n['ref[@]']\n['ref', 'A B C']\n['a[@]', 'A B', 'C']\n", got "['ref', 'a[@]']\nstatus=0\n['ref[@]', 'X', 'Y', 'Z']\n"
[osh status] Expected 0, got 1

stdout:
['ref', 'a[@]']
status=0
['ref[@]', 'X', 'Y', 'Z']
stderr:
  argv.py ref "$ref"  # JOINING mangles the array?
               ^~~~
[ stdin ]:8: fatal: Array 'ref' can't be referred to as a scalar (without @ or *)
osh_.py27 a[@] in nameref (eval_unsafe_arith)

[osh_.py stdout] Expected "['ref', 'A B C']\nstatus=1\n['ref[@]']\n['ref', 'A B C']\n['a[@]', 'A B', 'C']\n", got "['ref', 'a[@]']\nstatus=0\n['ref[@]', 'X', 'Y', 'Z']\n"
[osh_.py status] Expected 0, got 1

stdout:
['ref', 'a[@]']
status=0
['ref[@]', 'X', 'Y', 'Z']
stderr:
  argv.py ref "$ref"  # JOINING mangles the array?
               ^~~~
[ stdin ]:8: fatal: Array 'ref' can't be referred to as a scalar (without @ or *)
osh_.cc27 a[@] in nameref (eval_unsafe_arith)

[osh_.cc stdout] Expected "['ref', 'A B C']\nstatus=1\n['ref[@]']\n['ref', 'A B C']\n['a[@]', 'A B', 'C']\n", got "['ref', 'a[@]']\n['ref[@]', 'X', 'Y', 'Z']\nstatus=0\n"
[osh_.cc status] Expected 0, got 1

stdout:
['ref', 'a[@]']
['ref[@]', 'X', 'Y', 'Z']
status=0
stderr:
  argv.py ref "$ref"  # JOINING mangles the array?
  ^~~~~~~
[ stdin ]:8: fatal: Array 'ref' can't be referred to as a scalar (without @ or *)

dumb_alloc:
	gNumNew = 2695
	gNumDelete = 300
	gMemPos = 88608

	gNumMalloc = 374
	gNumFree = 0
	gMemPos2 = 14528
osh29 bad mutation through nameref: ref[0]= where ref is array[0]

[osh stdout] Expected 'status=1\nX Y Z\n', got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
  ref[0]=foo  # error in bash: 'array[0]': not a valid identifier
  ^~~~
[ stdin ]:3: fatal: Can't assign to items in a string
osh_.py29 bad mutation through nameref: ref[0]= where ref is array[0]

[osh_.py stdout] Expected 'status=1\nX Y Z\n', got ''
[osh_.py status] Expected 0, got 1

stdout:
stderr: 
  ref[0]=foo  # error in bash: 'array[0]': not a valid identifier
  ^~~~
[ stdin ]:3: fatal: Can't assign to items in a string
osh_.cc29 bad mutation through nameref: ref[0]= where ref is array[0]

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

stdout:
stderr: 
  ref[0]=foo  # error in bash: 'array[0]': not a valid identifier
  ^~~~
[ stdin ]:3: fatal: Can't assign to items in a string

dumb_alloc:
	gNumNew = 1914
	gNumDelete = 154
	gMemPos = 65888

	gNumMalloc = 84
	gNumFree = 0
	gMemPos2 = 9792
osh30 @ in nameref isn't supported, unlike in ${!ref}

[osh stdout] Expected u'', got 'status=0\nref=@\nstatus=0\n'
[osh status] Expected 1, got 0

stdout:
status=0
ref=@
status=0
stderr:
osh_.py30 @ in nameref isn't supported, unlike in ${!ref}

[osh_.py stdout] Expected u'', got 'status=0\nref=@\nstatus=0\n'
[osh_.py status] Expected 1, got 0

stdout:
status=0
ref=@
status=0
stderr:
osh_.cc30 @ in nameref isn't supported, unlike in ${!ref}

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

stdout:
status=0
ref=@
status=0
stderr:
dumb_alloc:
	gNumNew = 2555
	gNumDelete = 262
	gMemPos = 84912

	gNumMalloc = 326
	gNumFree = 0
	gMemPos2 = 13712
osh31 Unquoted assoc reference on RHS

[osh stdout] Expected "['bar']\n", got "['bashup_ev_r[foo]']\n"

stdout:
['bashup_ev_r[foo]']
stderr:
osh_.py31 Unquoted assoc reference on RHS

[osh_.py stdout] Expected "['bar']\n", got "['bashup_ev_r[foo]']\n"

stdout:
['bashup_ev_r[foo]']
stderr:
osh_.cc31 Unquoted assoc reference on RHS

[osh_.cc stdout] Expected "['bar']\n", got "['bashup_ev_r[foo]']\n"

stdout:
['bashup_ev_r[foo]']
stderr:
dumb_alloc:
	gNumNew = 2286
	gNumDelete = 253
	gMemPos = 77808

	gNumMalloc = 130
	gNumFree = 0
	gMemPos2 = 10512