Results for nameref.test.sh

statusoshosh_.pyosh_.cc
pass 252424
FAIL 788
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 FAIL FAIL exported nameref
detailsdetails
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
73 passed, 0 OK, 0 not implemented, 0 BUG, 23 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:
osh_.py16 exported nameref

[osh_.py stdout] Expected 'None\nx\n---\nfoo\nx\n', got '---\n'
[osh_.py status] Expected 0, got 127

stdout:
---
stderr:
  printenv.py x ref
  ^~~~~~~~~~~
[ stdin ]:3: 'printenv.py' not found
  printenv.py x ref
  ^~~~~~~~~~~
[ stdin ]:6: 'printenv.py' not found
osh_.cc16 exported nameref

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

stdout:
---
stderr:
  printenv.py x ref
  ^~~~~~~~~~~
[ stdin ]:3: 'printenv.py' not found
  printenv.py x ref
  ^~~~~~~~~~~
[ stdin ]:6: 'printenv.py' not found
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:
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:
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 'status=0\n'
[osh_.py status] Expected 0, got 1

stdout:
status=0
stderr:
  argv.py ref "$ref"  # READ through ref works
  ^~~~~~~
[ stdin ]:4: 'argv.py' not found
  argv.py 'ref[@]' "${ref[@]}"
  ^~~~~~~
[ stdin ]:7: 'argv.py' not found
  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 'status=0\n'
[osh_.cc status] Expected 0, got 1

stdout:
status=0
stderr:
  argv.py ref "$ref"  # READ through ref works
  ^~~~~~~
[ stdin ]:4: 'argv.py' not found
  argv.py 'ref[@]' "${ref[@]}"
  ^~~~~~~
[ stdin ]:7: 'argv.py' not found
  argv.py ref "$ref"  # JOINING mangles the array?
  ^~~~~~~
[ stdin ]:8: fatal: Array 'ref' can't be referred to as a scalar (without @ or *)
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
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:
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 ''
[osh_.py status] Expected 0, got 127

stdout:
stderr: 
    argv.py "$f"
    ^~~~~~~
[ stdin ]:6: 'argv.py' not found
osh_.cc31 Unquoted assoc reference on RHS

[osh_.cc stdout] Expected "['bar']\n", got ''
[osh_.cc status] Expected 0, got 127

stdout:
stderr: 
    argv.py "$f"
    ^~~~~~~
[ stdin ]:6: 'argv.py' not found