Results for nameref.test.sh

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

Details on runs that didn't PASS

dash0 pass array by reference

[dash stdout] Expected 'zo\n', got ''
[dash status] Expected 0, got 2

stdout:
stderr: 
dash: 6: Syntax error: "(" unexpected
ash0 pass array by reference

[ash stdout] Expected 'zo\n', got ''
[ash status] Expected 0, got 2

stdout:
stderr: 
ash: syntax error: unexpected "("
zsh0 pass array by reference

[zsh stdout] Expected 'zo\n', got '\n'

stdout:
stderr: 
show_value:1: bad option: -n
toysh0 pass array by reference

[toysh stdout] Expected 'zo\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 6: sh: syntax error: ga
sush0 pass array by reference

[sush stdout] Expected 'zo\n', got '\n'

stdout:
stderr: 
brush0 pass array by reference

[brush stdout] Expected 'zo\n', got '\n'

stdout:
stderr: 
dash1 mutate array by reference

[dash stdout] Expected 'a ZZZ c d\n', got ''
[dash status] Expected 0, got 2

stdout:
stderr: 
dash: 6: Syntax error: "(" unexpected
ash1 mutate array by reference

[ash stdout] Expected 'a ZZZ c d\n', got ''
[ash status] Expected 0, got 2

stdout:
stderr: 
ash: syntax error: unexpected "("
zsh1 mutate array by reference

[zsh stdout] Expected 'a ZZZ c d\n', got 'a b c d\n'

stdout:
a b c d
stderr:
set1:1: bad option: -n
toysh1 mutate array by reference

[toysh stdout] Expected 'a ZZZ c d\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 6: sh: syntax error: a
sush1 mutate array by reference

[sush stdout] Expected 'a ZZZ c d\n', got 'a b c d\n'

stdout:
a b c d
stderr:
brush1 mutate array by reference

[brush stdout] Expected 'a ZZZ c d\n', got 'a b c d\n'

stdout:
a b c d
stderr:
dash2 pass assoc array by reference

[dash stdout] Expected 'jam\n', got ''
[dash status] Expected 0, got 2

stdout:
stderr: 
dash: 6: Syntax error: "(" unexpected
ash2 pass assoc array by reference

[ash stdout] Expected 'jam\n', got ''
[ash status] Expected 0, got 2

stdout:
stderr: 
ash: syntax error: unexpected "("
zsh2 pass assoc array by reference

[zsh stdout] Expected 'jam\n', got ''
[zsh status] Expected 0, got 1

stdout:
stderr: 
zsh: no matches found: [monday]=eggs
mksh2 pass assoc array by reference

stdout:
[monday]=eggs
stderr:
ksh2 pass assoc array by reference

[ksh stdout] Expected 'jam\n', got '[monday]=eggs\n'

stdout:
[monday]=eggs
stderr:
toysh2 pass assoc array by reference

[toysh stdout] Expected 'jam\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 6: sh: syntax error: [monday]=eggs
sush2 pass assoc array by reference

[sush stdout] Expected 'jam\n', got 'days\n'

stdout:
days
stderr:
brush2 pass assoc array by reference

[brush stdout] Expected 'jam\n', got 'days\n'

stdout:
days
stderr:
dash3 pass local array by reference, relying on DYNAMIC SCOPING

[dash stdout] Expected 'zo\n', got ''
[dash status] Expected 0, got 2

stdout:
stderr: 
dash: 7: Syntax error: "(" unexpected (expecting "}")
ash3 pass local array by reference, relying on DYNAMIC SCOPING

[ash stdout] Expected 'zo\n', got ''
[ash status] Expected 0, got 2

stdout:
stderr: 
ash: syntax error: unexpected "(" (expecting "}")
zsh3 pass local array by reference, relying on DYNAMIC SCOPING

[zsh stdout] Expected 'zo\n', got '\n'

stdout:
stderr: 
show_value:1: bad option: -n
mksh3 pass local array by reference, relying on DYNAMIC SCOPING

stdout:
stderr: 
mksh: <stdin>[7]: syntax error: '(' unexpected
ksh3 pass local array by reference, relying on DYNAMIC SCOPING

[ksh stdout] Expected 'zo\n', got ''
[ksh status] Expected 0, got 1

stdout:
stderr: 
E: ksh: <stdin>[7]: syntax error: unexpected '('
toysh3 pass local array by reference, relying on DYNAMIC SCOPING

[toysh stdout] Expected 'zo\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 6: sh: syntax error: )
sush3 pass local array by reference, relying on DYNAMIC SCOPING

[sush stdout] Expected 'zo\n', got '\n'

stdout:
stderr: 
brush3 pass local array by reference, relying on DYNAMIC SCOPING

[brush stdout] Expected 'zo\n', got '\n'

stdout:
stderr: 
dash4 flag -n and +n

[dash stdout] Expected 'ref=x\nref=foo\nref=bar\nref=x\n', got 'ref=x\nref=x\nref=x\nref=x\n'

stdout:
ref=x
ref=x
ref=x
ref=x
stderr:
dash: 7: typeset: not found
dash: 13: typeset: not found
ash4 flag -n and +n

[ash stdout] Expected 'ref=x\nref=foo\nref=bar\nref=x\n', got 'ref=x\nref=x\nref=x\nref=x\n'

stdout:
ref=x
ref=x
ref=x
ref=x
stderr:
ash: typeset: not found
ash: typeset: not found
zsh4 flag -n and +n

[zsh stdout] Expected 'ref=x\nref=foo\nref=bar\nref=x\n', got 'ref=x\nref=x\nref=x\nref=x\n'

stdout:
ref=x
ref=x
ref=x
ref=x
stderr:
zsh: bad option: -n
zsh: bad option: -n
toysh4 flag -n and +n

[toysh stdout] Expected 'ref=x\nref=foo\nref=bar\nref=x\n', got 'ref=x\nref=x\nref=x\nref=x\n'

stdout:
ref=x
ref=x
ref=x
ref=x
stderr:
sh: typeset: No such file or directory
sh: typeset: No such file or directory
sush4 flag -n and +n

[sush stdout] Expected 'ref=x\nref=foo\nref=bar\nref=x\n', got 'ref=x\nref=x\nref=x\nref=x\n'

stdout:
ref=x
ref=x
ref=x
ref=x
stderr:
brush4 flag -n and +n

[brush stdout] Expected 'ref=x\nref=foo\nref=bar\nref=x\n', got 'ref=x\nref=x\nref=x\nref=x\n'

stdout:
ref=x
ref=x
ref=x
ref=x
stderr:
dash5 mutating through nameref: ref=

[dash stdout] Expected '1 ref=y\n2 ref=YY\n3 ref=XXXX\n4 y=XXXX\n', got '1 ref=y\n2 ref=y\n3 ref=XXXX\n4 y=YY\n'

stdout:
1 ref=y
2 ref=y
3 ref=XXXX
4 y=YY
stderr:
dash: 8: typeset: not found
ash5 mutating through nameref: ref=

[ash stdout] Expected '1 ref=y\n2 ref=YY\n3 ref=XXXX\n4 y=XXXX\n', got '1 ref=y\n2 ref=y\n3 ref=XXXX\n4 y=YY\n'

stdout:
1 ref=y
2 ref=y
3 ref=XXXX
4 y=YY
stderr:
ash: typeset: not found
zsh5 mutating through nameref: ref=

[zsh stdout] Expected '1 ref=y\n2 ref=YY\n3 ref=XXXX\n4 y=XXXX\n', got '1 ref=y\n2 ref=y\n3 ref=XXXX\n4 y=YY\n'

stdout:
1 ref=y
2 ref=y
3 ref=XXXX
4 y=YY
stderr:
zsh: bad option: -n
toysh5 mutating through nameref: ref=

[toysh stdout] Expected '1 ref=y\n2 ref=YY\n3 ref=XXXX\n4 y=XXXX\n', got '1 ref=y\n2 ref=y\n3 ref=XXXX\n4 y=YY\n'

stdout:
1 ref=y
2 ref=y
3 ref=XXXX
4 y=YY
stderr:
sh: typeset: No such file or directory
sush5 mutating through nameref: ref=

[sush stdout] Expected '1 ref=y\n2 ref=YY\n3 ref=XXXX\n4 y=XXXX\n', got '1 ref=y\n2 ref=y\n3 ref=XXXX\n4 y=YY\n'

stdout:
1 ref=y
2 ref=y
3 ref=XXXX
4 y=YY
stderr:
brush5 mutating through nameref: ref=

[brush stdout] Expected '1 ref=y\n2 ref=YY\n3 ref=XXXX\n4 y=XXXX\n', got '1 ref=y\n2 ref=y\n3 ref=XXXX\n4 y=YY\n'

stdout:
1 ref=y
2 ref=y
3 ref=XXXX
4 y=YY
stderr:
dash6 flag -n combined ${!ref} -- bash INVERTS

[dash stdout] Expected 'ref=x\n!ref=foo\nNOW A NAMEREF\nref=foo\n!ref=x\n' Got 'ref=x\n'
[dash status] Expected 0, got 2

stdout:
ref=x
stderr:
dash: 7: Bad substitution
ash6 flag -n combined ${!ref} -- bash INVERTS

[ash stdout] Expected 'ref=x\n!ref=foo\nNOW A NAMEREF\nref=foo\n!ref=x\n' Got 'ref=x\n'
[ash status] Expected 0, got 2

stdout:
ref=x
stderr:
ash: syntax error: bad substitution
zsh6 flag -n combined ${!ref} -- bash INVERTS

[zsh stdout] Expected 'ref=x\n!ref=foo\nNOW A NAMEREF\nref=foo\n!ref=x\n' Got 'ref=x\n'
[zsh status] Expected 0, got 1

stdout:
ref=x
stderr:
zsh: bad substitution
mksh6 flag -n combined ${!ref} -- bash INVERTS

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

[ksh stdout] Expected 'ref=x\n!ref=foo\nNOW A NAMEREF\nref=foo\n!ref=x\n' Got 'ref=x\n!ref=ref\nNOW A NAMEREF\nref=foo\n!ref=x\n'

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

[toysh 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=x\n!ref=foo\n'

stdout:
ref=x
!ref=foo
NOW A NAMEREF
ref=x
!ref=foo
stderr:
sh: typeset: No such file or directory
sush6 flag -n combined ${!ref} -- bash INVERTS

[sush 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=x\n!ref=foo\n'

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

[brush 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=x\n!ref=foo\n'

stdout:
ref=x
!ref=foo
NOW A NAMEREF
ref=x
!ref=foo
stderr:
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:
mksh7 named ref with $# doesn't work

stdout:
ref=#
ref=3
stderr:
ksh7 named ref with $# doesn't work

[ksh stdout] Expected 'ref=#\nref=#\n', got 'ref=#\nref=3\n'

stdout:
ref=#
ref=3
stderr:
bash8 named ref with $# and shopt -s strict_nameref

stdout:
ref=#
ref=#
stderr:
bash: line 1: shopt: strict_nameref: invalid shell option name
bash: line 5: typeset: `#': invalid variable name for name reference
dash8 named ref with $# and shopt -s strict_nameref

[dash stdout] Expected 'ref=#\n', got 'ref=#\nref=#\n'
[dash status] Expected 1, got 0

stdout:
ref=#
ref=#
stderr:
dash: 1: shopt: not found
dash: 5: typeset: not found
ash8 named ref with $# and shopt -s strict_nameref

[ash stdout] Expected 'ref=#\n', got 'ref=#\nref=#\n'
[ash status] Expected 1, got 0

stdout:
ref=#
ref=#
stderr:
ash: shopt: not found
ash: typeset: not found
zsh8 named ref with $# and shopt -s strict_nameref

[zsh stdout] Expected 'ref=#\n', got 'ref=#\nref=#\n'
[zsh status] Expected 1, got 0

stdout:
ref=#
ref=#
stderr:
zsh: command not found: shopt
zsh: bad option: -n
mksh8 named ref with $# and shopt -s strict_nameref

stdout:
ref=#
ref=0
stderr:
mksh: <stdin>[1]: shopt: not found
ksh8 named ref with $# and shopt -s strict_nameref

[ksh stdout] Expected 'ref=#\n', got 'ref=#\nref=0\n'
[ksh status] Expected 1, got 0

stdout:
ref=#
ref=0
stderr:
E: ksh: <stdin>[1]: shopt: inaccessible or not found
toysh8 named ref with $# and shopt -s strict_nameref

[toysh stdout] Expected 'ref=#\n', got 'ref=#\nref=#\n'
[toysh status] Expected 1, got 0

stdout:
ref=#
ref=#
stderr:
sh: shopt: No such file or directory
sh: typeset: No such file or directory
sush8 named ref with $# and shopt -s strict_nameref

[sush stdout] Expected 'ref=#\n', got 'ref=#\nref=#\n'
[sush status] Expected 1, got 0

stdout:
ref=#
ref=#
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: shopt: strict_nameref: not supported yet
brush8 named ref with $# and shopt -s strict_nameref

[brush stdout] Expected 'ref=#\n', got 'ref=#\nref=#\n'
[brush status] Expected 1, got 0

stdout:
ref=#
ref=#
stderr:
shopt: strict_nameref: invalid shell option name
dash9 named ref with 1 $1 etc.

[dash stdout] Expected 'ref=1\nref=1\nref2=$1\nref2=$1\nref3=x\nref3=foo\n' Got 'ref=1\nref=1\nref2=$1\nref2=$1\nref3=x\nref3=x\n'

stdout:
ref=1
ref=1
ref2=$1
ref2=$1
ref3=x
ref3=x
stderr:
dash: 7: typeset: not found
dash: 12: typeset: not found
dash: 19: typeset: not found
ash9 named ref with 1 $1 etc.

[ash stdout] Expected 'ref=1\nref=1\nref2=$1\nref2=$1\nref3=x\nref3=foo\n' Got 'ref=1\nref=1\nref2=$1\nref2=$1\nref3=x\nref3=x\n'

stdout:
ref=1
ref=1
ref2=$1
ref2=$1
ref3=x
ref3=x
stderr:
ash: typeset: not found
ash: typeset: not found
ash: typeset: not found
zsh9 named ref with 1 $1 etc.

[zsh stdout] Expected 'ref=1\nref=1\nref2=$1\nref2=$1\nref3=x\nref3=foo\n' Got 'ref=1\nref=1\nref2=$1\nref2=$1\nref3=x\nref3=x\n'

stdout:
ref=1
ref=1
ref2=$1
ref2=$1
ref3=x
ref3=x
stderr:
zsh: bad option: -n
zsh: bad option: -n
zsh: bad option: -n
mksh9 named ref with 1 $1 etc.

stdout:
ref=1
ref=one
ref2=$1
stderr:
mksh: <stdin>[12]: ref2: empty nameref target
ksh9 named ref with 1 $1 etc.

[ksh stdout] Expected 'ref=1\nref=1\nref2=$1\nref2=$1\nref3=x\nref3=foo\n' Got 'ref=1\nref=one\nref2=$1\nref2=$1\nref3=x\nref3=foo\n'

stdout:
ref=1
ref=one
ref2=$1
ref2=$1
ref3=x
ref3=foo
stderr:
E: ksh: <stdin>[12]: typeset: ref2: empty nameref target
toysh9 named ref with 1 $1 etc.

[toysh stdout] Expected 'ref=1\nref=1\nref2=$1\nref2=$1\nref3=x\nref3=foo\n' Got 'ref=1\nref=1\nref2=$1\nref2=$1\nref3=x\nref3=x\n'

stdout:
ref=1
ref=1
ref2=$1
ref2=$1
ref3=x
ref3=x
stderr:
set: bad --
sh: typeset: No such file or directory
sh: typeset: No such file or directory
sh: typeset: No such file or directory
sush9 named ref with 1 $1 etc.

[sush stdout] Expected 'ref=1\nref=1\nref2=$1\nref2=$1\nref3=x\nref3=foo\n' Got 'ref=1\nref=1\nref2=$1\nref2=$1\nref3=x\nref3=x\n'

stdout:
ref=1
ref=1
ref2=$1
ref2=$1
ref3=x
ref3=x
stderr:
brush9 named ref with 1 $1 etc.

[brush stdout] Expected 'ref=1\nref=1\nref2=$1\nref2=$1\nref3=x\nref3=foo\n' Got 'ref=1\nref=1\nref2=$1\nref2=$1\nref3=x\nref3=x\n'

stdout:
ref=1
ref=1
ref2=$1
ref2=$1
ref3=x
ref3=x
stderr:
mksh10 assign to invalid ref

stdout:
ref=1
ref=
stderr:
mksh: <stdin>[7]: read-only: ref
ksh10 assign to invalid ref

[ksh stdout] Expected 'ref=1\nref=1\nref=foo\n', got 'ref=1\nref=\n'
[ksh status] Expected 0, got 2

stdout:
ref=1
ref=
stderr:
E: ksh: <stdin>[7]: read-only: ref
bash11 assign to invalid ref with strict_nameref

stdout:
stderr: 
dash11 assign to invalid ref with strict_nameref

[dash stdout] Expected 'ref=1\n', got 'ref=1\nref=1\nref=foo\n'
[dash status] Expected 1, got 0

stdout:
ref=1
ref=1
ref=foo
stderr:
dash: 3: shopt: not found
dash: 8: typeset: not found
ash11 assign to invalid ref with strict_nameref

[ash stdout] Expected 'ref=1\n', got 'ref=1\nref=1\nref=foo\n'
[ash status] Expected 1, got 0

stdout:
ref=1
ref=1
ref=foo
stderr:
ash: shopt: not found
ash: typeset: not found
zsh11 assign to invalid ref with strict_nameref

[zsh stdout] Expected 'ref=1\n', got 'ref=1\nref=1\nref=foo\n'
[zsh status] Expected 1, got 0

stdout:
ref=1
ref=1
ref=foo
stderr:
zsh: command not found: shopt
zsh: bad option: -n
mksh11 assign to invalid ref with strict_nameref

stdout:
stderr: 
ksh11 assign to invalid ref with strict_nameref

[ksh stdout] Expected 'ref=1\n', got 'ref=1\nref=\n'
[ksh status] Expected 1, got 2

stdout:
ref=1
ref=
stderr:
E: ksh: <stdin>[3]: shopt: inaccessible or not found
E: ksh: <stdin>[11]: read-only: ref
toysh11 assign to invalid ref with strict_nameref

[toysh stdout] Expected 'ref=1\n', got ''
[toysh status] Expected 1, got -6

stdout:
stderr: 
munmap_chunk(): invalid pointer
sush11 assign to invalid ref with strict_nameref

[sush stdout] Expected 'ref=1\n', got 'ref=1\nref=1\nref=foo\n'
[sush status] Expected 1, got 0

stdout:
ref=1
ref=1
ref=foo
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 3: shopt: strict_nameref: not supported yet
brush11 assign to invalid ref with strict_nameref

[brush stdout] Expected 'ref=1\n', got 'ref=1\nref=1\nref=foo\n'
[brush status] Expected 1, got 0

stdout:
ref=1
ref=1
ref=foo
stderr:
shopt: strict_nameref: invalid shell option name
dash12 name ref on Undef cell

[dash status] Expected 1, got 2

stdout:
ref=
nounset
stderr:
dash: 1: typeset: not found
dash: 7: ref: parameter not set
ash12 name ref on Undef cell

[ash status] Expected 1, got 2

stdout:
ref=
nounset
stderr:
ash: typeset: not found
ash: ref: parameter not set
mksh12 name ref on Undef cell

stdout:
stderr: 
mksh: <stdin>[1]: ref: empty nameref target
toysh12 name ref on Undef cell

[toysh stdout] Expected 'ref=\nnounset\n', got 'ref=\nnounset\nref=\n'
[toysh status] Expected 1, got 0

stdout:
ref=
nounset
ref=
stderr:
sh: typeset: No such file or directory
set: bad -o nounset
sush12 name ref on Undef cell

[sush stdout] Expected 'ref=\nnounset\n', got 'ref=\nnounset\nref=\n'
[sush status] Expected 1, got 0

stdout:
ref=
nounset
ref=
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 6: set: nounset: invalid option name
brush12 name ref on Undef cell

[brush stdout] Expected 'ref=\nnounset\n', got 'ref=\nnounset\nref=\n'
[brush status] Expected 1, got 0

stdout:
ref=
nounset
ref=
stderr:
dash13 assign to empty nameref and invalid nameref

[dash stdout] Expected 'ref=\nref=\nref2=\nref2=x\n', got 'ref=\nref=x\nref2=\nref2=x\n'

stdout:
ref=
ref=x
ref2=
ref2=x
stderr:
dash: 1: typeset: not found
dash: 7: typeset: not found
ash13 assign to empty nameref and invalid nameref

[ash stdout] Expected 'ref=\nref=\nref2=\nref2=x\n', got 'ref=\nref=x\nref2=\nref2=x\n'

stdout:
ref=
ref=x
ref2=
ref2=x
stderr:
ash: typeset: not found
ash: typeset: not found
zsh13 assign to empty nameref and invalid nameref

[zsh stdout] Expected 'ref=\nref=\nref2=\nref2=x\n', got 'ref=\nref=x\nref2=\nref2=x\n'

stdout:
ref=
ref=x
ref2=
ref2=x
stderr:
zsh: bad option: -n
zsh: bad option: -n
mksh13 assign to empty nameref and invalid nameref

stdout:
stderr: 
mksh: <stdin>[1]: ref: empty nameref target
ksh13 assign to empty nameref and invalid nameref

[ksh stdout] Expected 'ref=\nref=\nref2=\nref2=x\n', got 'ref=\nref=x\nref2=\nref2=x\n'

stdout:
ref=
ref=x
ref2=
ref2=x
stderr:
E: ksh: <stdin>[1]: typeset: ref: empty nameref target
toysh13 assign to empty nameref and invalid nameref

[toysh stdout] Expected 'ref=\nref=\nref2=\nref2=x\n', got 'ref=\nref=x\nref2=\nref2=x\n'

stdout:
ref=
ref=x
ref2=
ref2=x
stderr:
sh: typeset: No such file or directory
sh: typeset: No such file or directory
sush13 assign to empty nameref and invalid nameref

[sush stdout] Expected 'ref=\nref=\nref2=\nref2=x\n', got 'ref=\nref=x\nref2=undef\nref2=x\n'

stdout:
ref=
ref=x
ref2=undef
ref2=x
stderr:
brush13 assign to empty nameref and invalid nameref

[brush stdout] Expected 'ref=\nref=\nref2=\nref2=x\n', got 'ref=\nref=x\nref2=undef\nref2=x\n'

stdout:
ref=
ref=x
ref2=undef
ref2=x
stderr:
dash14 -n attribute before it has a value

[dash stdout] Expected 'ref=\nref=XX\n', got 'ref=\nref=x\n'

stdout:
ref=
ref=x
stderr:
dash: 1: typeset: not found
ash14 -n attribute before it has a value

[ash stdout] Expected 'ref=\nref=XX\n', got 'ref=\nref=x\n'

stdout:
ref=
ref=x
stderr:
ash: typeset: not found
zsh14 -n attribute before it has a value

[zsh stdout] Expected 'ref=\nref=XX\n', got 'ref=\nref=x\n'

stdout:
ref=
ref=x
stderr:
zsh: bad option: -n
mksh14 -n attribute before it has a value

stdout:
stderr: 
mksh: <stdin>[1]: ref: empty nameref target
ksh14 -n attribute before it has a value

[ksh stdout] Expected 'ref=\nref=XX\n', got 'ref=\nref=x\n'

stdout:
ref=
ref=x
stderr:
E: ksh: <stdin>[1]: typeset: ref: empty nameref target
toysh14 -n attribute before it has a value

[toysh stdout] Expected 'ref=\nref=XX\n', got 'ref=\nref=x\n'

stdout:
ref=
ref=x
stderr:
sh: typeset: No such file or directory
sush14 -n attribute before it has a value

[sush stdout] Expected 'ref=\nref=XX\n', got 'ref=\nref=x\n'

stdout:
ref=
ref=x
stderr:
brush14 -n attribute before it has a value

[brush stdout] Expected 'ref=\nref=XX\n', got 'ref=\nref=x\n'

stdout:
ref=
ref=x
stderr:
bash15 -n attribute on array is hard error, not a warning

stdout:
hi
ref=x
stderr:
bash: line 5: warning: ref: removing nameref attribute
dash15 -n attribute on array is hard error, not a warning

[dash status] Expected 1, got 2

stdout:
hi
stderr:
dash: 2: typeset: not found
dash: 5: Syntax error: "(" unexpected
ash15 -n attribute on array is hard error, not a warning

[ash status] Expected 1, got 2

stdout:
hi
stderr:
ash: typeset: not found
ash: syntax error: unexpected "("
zsh15 -n attribute on array is hard error, not a warning

[zsh stdout] Expected 'hi\n', got 'hi\nref=x y\n'
[zsh status] Expected 1, got 0

stdout:
hi
ref=x y
stderr:
zsh: bad option: -n
mksh15 -n attribute on array is hard error, not a warning

stdout:
stderr: 
mksh: <stdin>[2]: ref: empty nameref target
ksh15 -n attribute on array is hard error, not a warning

[ksh stdout] Expected 'hi\n', got 'hi\nref=x\n'
[ksh status] Expected 1, got 0

stdout:
hi
ref=x
stderr:
E: ksh: <stdin>[2]: typeset: ref: empty nameref target
toysh15 -n attribute on array is hard error, not a warning

[toysh status] Expected 1, got 2

stdout:
hi
stderr:
sh: typeset: No such file or directory
main: line 5: sh: syntax error: x
sush15 -n attribute on array is hard error, not a warning

[sush stdout] Expected 'hi\n', got 'hi\nref=x\n'
[sush status] Expected 1, got 0

stdout:
hi
ref=x
stderr:
brush15 -n attribute on array is hard error, not a warning

[brush stdout] Expected 'hi\n', got 'hi\nref=x\n'
[brush status] Expected 1, got 0

stdout:
hi
ref=x
stderr:
dash16 exported nameref

[dash stdout] Expected 'None\nx\n---\nfoo\nx\n', got 'None\nNone\n---\nfoo\nNone\n'

stdout:
None
None
---
foo
None
stderr:
dash: 2: typeset: not found
ash16 exported nameref

[ash stdout] Expected 'None\nx\n---\nfoo\nx\n', got 'None\nNone\n---\nfoo\nNone\n'

stdout:
None
None
---
foo
None
stderr:
ash: typeset: not found
zsh16 exported nameref

[zsh stdout] Expected 'None\nx\n---\nfoo\nx\n', got 'None\nNone\n---\nfoo\nNone\n'

stdout:
None
None
---
foo
None
stderr:
zsh: bad option: -n
mksh16 exported nameref

stdout:
None
None
---
foo
None
stderr:
ksh16 exported nameref

[ksh stdout] Expected 'None\nx\n---\nfoo\nx\n', got 'None\nNone\n---\nfoo\nNone\n'

stdout:
None
None
---
foo
None
stderr:
toysh16 exported nameref

[toysh stdout] Expected 'None\nx\n---\nfoo\nx\n', got 'None\nNone\n---\nfoo\nNone\n'

stdout:
None
None
---
foo
None
stderr:
sh: typeset: No such file or directory
sush16 exported nameref

[sush stdout] Expected 'None\nx\n---\nfoo\nx\n', got 'None\nNone\n---\nfoo\nNone\n'

stdout:
None
None
---
foo
None
stderr:
dash17 readonly nameref doesn't prevent assigning through it

[dash stdout] Expected 'ref=XX\nref=XXXX\nx=X\n', got 'ref=\nref=XXXX\nx=X\n'

stdout:
ref=
ref=XXXX
x=X
stderr:
dash: 2: typeset: not found
ash17 readonly nameref doesn't prevent assigning through it

[ash stdout] Expected 'ref=XX\nref=XXXX\nx=X\n', got 'ref=\nref=XXXX\nx=X\n'

stdout:
ref=
ref=XXXX
x=X
stderr:
ash: typeset: not found
zsh17 readonly nameref doesn't prevent assigning through it

[zsh stdout] Expected 'ref=XX\nref=XXXX\nx=X\n', got 'ref=\nref=XXXX\nx=X\n'

stdout:
ref=
ref=XXXX
x=X
stderr:
zsh: bad option: -n
toysh17 readonly nameref doesn't prevent assigning through it

[toysh stdout] Expected 'ref=XX\nref=XXXX\nx=X\n', got 'ref=\nref=XXXX\nx=X\n'

stdout:
ref=
ref=XXXX
x=X
stderr:
sh: typeset: No such file or directory
sush17 readonly nameref doesn't prevent assigning through it

[sush stdout] Expected 'ref=XX\nref=XXXX\nx=X\n', got 'ref=x\nref=x\nx=X\n'

stdout:
ref=x
ref=x
x=X
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 6: ref: readonly variable
brush17 readonly nameref doesn't prevent assigning through it

[brush stdout] Expected 'ref=XX\nref=XXXX\nx=X\n', got 'ref=x\nref=x\nx=X\n'

stdout:
ref=x
ref=x
x=X
stderr:
ERROR error: cannot mutate readonly variable
bash18 readonly var can't be assigned through nameref

stdout:
ref=X
ref=XX
ref=XX
x=XX
stderr:
bash: line 11: x: readonly variable
dash18 readonly var can't be assigned through nameref

[dash stdout] Expected 'ref=X\nref=XX\n', got 'ref=\nref=XX\nref=XXX\nx=X\n'
[dash status] Expected 1, got 0

stdout:
ref=
ref=XX
ref=XXX
x=X
stderr:
dash: 2: typeset: not found
dash: 9: typeset: not found
ash18 readonly var can't be assigned through nameref

[ash stdout] Expected 'ref=X\nref=XX\n', got 'ref=\nref=XX\nref=XXX\nx=X\n'
[ash status] Expected 1, got 0

stdout:
ref=
ref=XX
ref=XXX
x=X
stderr:
ash: typeset: not found
ash: typeset: not found
zsh18 readonly var can't be assigned through nameref

[zsh stdout] Expected 'ref=X\nref=XX\n', got 'ref=\nref=XX\nref=XXX\nx=X\n'
[zsh status] Expected 1, got 0

stdout:
ref=
ref=XX
ref=XXX
x=X
stderr:
zsh: bad option: -n
mksh18 readonly var can't be assigned through nameref

stdout:
ref=X
ref=XX
stderr:
mksh: <stdin>[11]: read-only: ref
ksh18 readonly var can't be assigned through nameref

[ksh status] Expected 1, got 2

stdout:
ref=X
ref=XX
stderr:
E: ksh: <stdin>[11]: read-only: ref
toysh18 readonly var can't be assigned through nameref

[toysh stdout] Expected 'ref=X\nref=XX\n', got 'ref=\nref=XX\nref=XXX\nx=X\n'
[toysh status] Expected 1, got 0

stdout:
ref=
ref=XX
ref=XXX
x=X
stderr:
sh: typeset: No such file or directory
sh: typeset: No such file or directory
sush18 readonly var can't be assigned through nameref

[sush stdout] Expected 'ref=X\nref=XX\n', got 'ref=x\nref=x\nref=x\nx=X\n'
[sush status] Expected 1, got 0

stdout:
ref=x
ref=x
ref=x
x=X
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 6: ref: readonly variable
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 11: ref: readonly variable
brush18 readonly var can't be assigned through nameref

[brush stdout] Expected 'ref=X\nref=XX\n', got 'ref=x\nref=x\nref=x\nx=X\n'
[brush status] Expected 1, got 0

stdout:
ref=x
ref=x
ref=x
x=X
stderr:
ERROR error: cannot mutate readonly variable
ERROR error: cannot mutate readonly variable
dash19 unset nameref

[dash stdout] Expected 'ref=X\nref=\nx=\n', got 'ref=\nref=\nx=X\n'

stdout:
ref=
ref=
x=X
stderr:
dash: 2: typeset: not found
ash19 unset nameref

[ash stdout] Expected 'ref=X\nref=\nx=\n', got 'ref=\nref=\nx=X\n'

stdout:
ref=
ref=
x=X
stderr:
ash: typeset: not found
zsh19 unset nameref

[zsh stdout] Expected 'ref=X\nref=\nx=\n', got 'ref=\nref=\nx=X\n'

stdout:
ref=
ref=
x=X
stderr:
zsh: bad option: -n
toysh19 unset nameref

[toysh stdout] Expected 'ref=X\nref=\nx=\n', got 'ref=\nref=\nx=X\n'

stdout:
ref=
ref=
x=X
stderr:
sh: typeset: No such file or directory
sush19 unset nameref

[sush stdout] Expected 'ref=X\nref=\nx=\n', got 'ref=x\nref=\nx=X\n'

stdout:
ref=x
ref=
x=X
stderr:
brush19 unset nameref

[brush stdout] Expected 'ref=X\nref=\nx=\n', got 'ref=x\nref=\nx=X\n'

stdout:
ref=x
ref=
x=X
stderr:
dash20 Chain of namerefs

[dash stdout] Expected 'ref_to_ref=foo\nref=foo\n', got 'ref_to_ref=\nref=\n'

stdout:
ref_to_ref=
ref=
stderr:
dash: 2: typeset: not found
dash: 3: typeset: not found
ash20 Chain of namerefs

[ash stdout] Expected 'ref_to_ref=foo\nref=foo\n', got 'ref_to_ref=\nref=\n'

stdout:
ref_to_ref=
ref=
stderr:
ash: typeset: not found
ash: typeset: not found
zsh20 Chain of namerefs

[zsh stdout] Expected 'ref_to_ref=foo\nref=foo\n', got 'ref_to_ref=\nref=\n'

stdout:
ref_to_ref=
ref=
stderr:
zsh: bad option: -n
zsh: bad option: -n
toysh20 Chain of namerefs

[toysh stdout] Expected 'ref_to_ref=foo\nref=foo\n', got 'ref_to_ref=\nref=\n'

stdout:
ref_to_ref=
ref=
stderr:
sh: typeset: No such file or directory
sh: typeset: No such file or directory
sush20 Chain of namerefs

[sush stdout] Expected 'ref_to_ref=foo\nref=foo\n', got 'ref_to_ref=ref\nref=x\n'

stdout:
ref_to_ref=ref
ref=x
stderr:
brush20 Chain of namerefs

[brush stdout] Expected 'ref_to_ref=foo\nref=foo\n', got 'ref_to_ref=ref\nref=x\n'

stdout:
ref_to_ref=ref
ref=x
stderr:
bash21 Mutually recursive namerefs detected on READ

stdout:
defined
ref1=
ref2=
stderr:
bash: line 4: warning: ref1: circular name reference
bash: line 5: warning: ref1: circular name reference
dash21 Mutually recursive namerefs detected on READ

[dash stdout] Expected 'defined\n', got 'defined\nref1=\nref2=\n'
[dash status] Expected 1, got 0

stdout:
defined
ref1=
ref2=
stderr:
dash: 1: typeset: not found
dash: 2: typeset: not found
ash21 Mutually recursive namerefs detected on READ

[ash stdout] Expected 'defined\n', got 'defined\nref1=\nref2=\n'
[ash status] Expected 1, got 0

stdout:
defined
ref1=
ref2=
stderr:
ash: typeset: not found
ash: typeset: not found
zsh21 Mutually recursive namerefs detected on READ

[zsh stdout] Expected 'defined\n', got 'defined\nref1=\nref2=\n'
[zsh status] Expected 1, got 0

stdout:
defined
ref1=
ref2=
stderr:
zsh: bad option: -n
zsh: bad option: -n
mksh21 Mutually recursive namerefs detected on READ

stdout:
stderr: 
mksh: <stdin>[2]: ref2: expression recurses on parameter
ksh21 Mutually recursive namerefs detected on READ

[ksh stdout] Expected 'defined\n', got 'defined\nref1=\nref2=\n'
[ksh status] Expected 1, got 0

stdout:
defined
ref1=
ref2=
stderr:
E: ksh: <stdin>[2]: typeset: ref2: expression recurses on parameter
toysh21 Mutually recursive namerefs detected on READ

[toysh stdout] Expected 'defined\n', got 'defined\nref1=\nref2=\n'
[toysh status] Expected 1, got 0

stdout:
defined
ref1=
ref2=
stderr:
sh: typeset: No such file or directory
sh: typeset: No such file or directory
sush21 Mutually recursive namerefs detected on READ

[sush stdout] Expected 'defined\n', got 'defined\nref1=ref2\nref2=ref2\n'
[sush status] Expected 1, got 0

stdout:
defined
ref1=ref2
ref2=ref2
stderr:
brush21 Mutually recursive namerefs detected on READ

[brush stdout] Expected 'defined\n', got 'defined\nref1=ref2\nref2=ref2\n'
[brush status] Expected 1, got 0

stdout:
defined
ref1=ref2
ref2=ref2
stderr:
bash22 Mutually recursive namerefs detected on WRITE

stdout:
defined 0
mutated 1
stderr:
bash: line 4: warning: ref1: circular name reference
dash22 Mutually recursive namerefs detected on WRITE

[dash stdout] Expected 'defined 0\n', got 'defined 127\nmutated 0\n'
[dash status] Expected 1, got 0

stdout:
defined 127
mutated 0
stderr:
dash: 1: typeset: not found
dash: 2: typeset: not found
ash22 Mutually recursive namerefs detected on WRITE

[ash stdout] Expected 'defined 0\n', got 'defined 127\nmutated 0\n'
[ash status] Expected 1, got 0

stdout:
defined 127
mutated 0
stderr:
ash: typeset: not found
ash: typeset: not found
zsh22 Mutually recursive namerefs detected on WRITE

[zsh stdout] Expected 'defined 0\n', got 'defined 1\nmutated 0\n'
[zsh status] Expected 1, got 0

stdout:
defined 1
mutated 0
stderr:
zsh: bad option: -n
zsh: bad option: -n
mksh22 Mutually recursive namerefs detected on WRITE

stdout:
stderr: 
mksh: <stdin>[2]: ref2: expression recurses on parameter
ksh22 Mutually recursive namerefs detected on WRITE

[ksh stdout] Expected 'defined 0\n', got 'defined 1\nmutated 0\n'
[ksh status] Expected 1, got 0

stdout:
defined 1
mutated 0
stderr:
E: ksh: <stdin>[2]: typeset: ref2: expression recurses on parameter
toysh22 Mutually recursive namerefs detected on WRITE

[toysh stdout] Expected 'defined 0\n', got 'defined 127\nmutated 0\n'
[toysh status] Expected 1, got 0

stdout:
defined 127
mutated 0
stderr:
sh: typeset: No such file or directory
sh: typeset: No such file or directory
sush22 Mutually recursive namerefs detected on WRITE

[sush stdout] Expected 'defined 0\n', got 'defined 0\nmutated 0\n'
[sush status] Expected 1, got 0

stdout:
defined 0
mutated 0
stderr:
brush22 Mutually recursive namerefs detected on WRITE

[brush stdout] Expected 'defined 0\n', got 'defined 0\nmutated 0\n'
[brush status] Expected 1, got 0

stdout:
defined 0
mutated 0
stderr:
dash23 Dynamic scope with namerefs

[dash stdout] Expected 'F1=F1\nF1=x\n', got 'F1=F1\n'
[dash status] Expected 0, got 2

stdout:
F1=F1
stderr:
dash: 2: local: -n: bad variable name
ash23 Dynamic scope with namerefs

[ash stdout] Expected 'F1=F1\nF1=x\n', got 'F1=F1\n'
[ash status] Expected 0, got 2

stdout:
F1=F1
stderr:
ash: local: line 2: -n: bad variable name
zsh23 Dynamic scope with namerefs

[zsh stdout] Expected 'F1=F1\nF1=x\n', got 'F1=F1\nF1=F1\n'

stdout:
F1=F1
F1=F1
stderr:
f3:1: bad option: -n
toysh23 Dynamic scope with namerefs

[toysh stdout] Expected 'F1=F1\nF1=x\n', got 'F1=F1\nF1=F1\n'

stdout:
F1=F1
F1=F1
stderr:
local: bad -n
sush23 Dynamic scope with namerefs

[sush stdout] Expected 'F1=F1\nF1=x\n', got 'F1=F1\nF1=F1\n'

stdout:
F1=F1
F1=F1
stderr:
brush23 Dynamic scope with namerefs

[brush stdout] Expected 'F1=F1\nF1=x\n', got 'F1=F1\nF1=F1\n'

stdout:
F1=F1
F1=F1
stderr:
dash24 change reference itself

[dash stdout] Expected 'ref=XX\nx=XX\ny=YY\n----\nref=YY\nx=XX\ny=YY\n----\nref=z\nx=XX\ny=z\n' Got 'ref=\nx=XX\ny=YY\n----\nref=\nx=XX\ny=YY\n----\nref=z\nx=XX\ny=YY\n'

stdout:
ref=
x=XX
y=YY
----
ref=
x=XX
y=YY
----
ref=z
x=XX
y=YY
stderr:
dash: 3: typeset: not found
dash: 9: typeset: not found
ash24 change reference itself

[ash stdout] Expected 'ref=XX\nx=XX\ny=YY\n----\nref=YY\nx=XX\ny=YY\n----\nref=z\nx=XX\ny=z\n' Got 'ref=\nx=XX\ny=YY\n----\nref=\nx=XX\ny=YY\n----\nref=z\nx=XX\ny=YY\n'

stdout:
ref=
x=XX
y=YY
----
ref=
x=XX
y=YY
----
ref=z
x=XX
y=YY
stderr:
ash: typeset: not found
ash: typeset: not found
zsh24 change reference itself

[zsh stdout] Expected 'ref=XX\nx=XX\ny=YY\n----\nref=YY\nx=XX\ny=YY\n----\nref=z\nx=XX\ny=z\n' Got 'ref=\nx=XX\ny=YY\n----\nref=\nx=XX\ny=YY\n----\nref=z\nx=XX\ny=YY\n'

stdout:
ref=
x=XX
y=YY
----
ref=
x=XX
y=YY
----
ref=z
x=XX
y=YY
stderr:
zsh: bad option: -n
zsh: bad option: -n
toysh24 change reference itself

[toysh stdout] Expected 'ref=XX\nx=XX\ny=YY\n----\nref=YY\nx=XX\ny=YY\n----\nref=z\nx=XX\ny=z\n' Got 'ref=\nx=XX\ny=YY\n----\nref=\nx=XX\ny=YY\n----\nref=z\nx=XX\ny=YY\n'

stdout:
ref=
x=XX
y=YY
----
ref=
x=XX
y=YY
----
ref=z
x=XX
y=YY
stderr:
sh: typeset: No such file or directory
sh: typeset: No such file or directory
sush24 change reference itself

[sush stdout] Expected 'ref=XX\nx=XX\ny=YY\n----\nref=YY\nx=XX\ny=YY\n----\nref=z\nx=XX\ny=z\n' Got 'ref=x\nx=XX\ny=YY\n----\nref=y\nx=XX\ny=YY\n----\nref=z\nx=XX\ny=YY\n'

stdout:
ref=x
x=XX
y=YY
----
ref=y
x=XX
y=YY
----
ref=z
x=XX
y=YY
stderr:
brush24 change reference itself

[brush stdout] Expected 'ref=XX\nx=XX\ny=YY\n----\nref=YY\nx=XX\ny=YY\n----\nref=z\nx=XX\ny=z\n' Got 'ref=x\nx=XX\ny=YY\n----\nref=y\nx=XX\ny=YY\n----\nref=z\nx=XX\ny=YY\n'

stdout:
ref=x
x=XX
y=YY
----
ref=y
x=XX
y=YY
----
ref=z
x=XX
y=YY
stderr:
dash25 a[2] in nameref

[dash stdout] Expected 'ref=two\n', got ''
[dash status] Expected 0, got 2

stdout:
stderr: 
dash: 1: typeset: not found
dash: 2: Syntax error: "(" unexpected
ash25 a[2] in nameref

[ash stdout] Expected 'ref=two\n', got ''
[ash status] Expected 0, got 2

stdout:
stderr: 
ash: typeset: not found
ash: syntax error: unexpected "("
zsh25 a[2] in nameref

[zsh stdout] Expected 'ref=two\n', got 'ref=\n'

stdout:
ref=
stderr:
zsh: bad option: -n
toysh25 a[2] in nameref

[toysh stdout] Expected 'ref=two\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
sh: typeset: No such file or directory
main: line 2: sh: syntax error: zero
sush25 a[2] in nameref

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

stdout:
ref=a[2]
stderr:
brush25 a[2] in nameref

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

stdout:
ref=a[2]
stderr:
osh25 a[2] in nameref

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

stdout:
ref=a[2]
stderr:
dash26 a[expr] in nameref

[dash stdout] Expected 'ref=three\n', got ''
[dash status] Expected 0, got 2

stdout:
stderr: 
dash: 1: typeset: not found
dash: 2: Syntax error: "(" unexpected
ash26 a[expr] in nameref

[ash stdout] Expected 'ref=three\n', got ''
[ash status] Expected 0, got 2

stdout:
stderr: 
ash: typeset: not found
ash: syntax error: unexpected "("
zsh26 a[expr] in nameref

[zsh stdout] Expected 'ref=three\n', got 'ref=\n'

stdout:
ref=
stderr:
zsh: bad option: -n
toysh26 a[expr] in nameref

[toysh stdout] Expected 'ref=three\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
sh: typeset: No such file or directory
main: line 2: sh: syntax error: zero
sush26 a[expr] in nameref

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

stdout:
ref=a[$(echo 2) + 1]
stderr:
brush26 a[expr] in nameref

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

stdout:
ref=a[$(echo 2) + 1]
stderr:
osh26 a[expr] in nameref

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

stdout:
ref=a[$(echo 2) + 1]
stderr:
dash27 a[@] in nameref

[dash stdout] Expected "['ref', 'A B', 'C']\nstatus=1\n['ref[@]']\n['ref', 'A B', 'C']\n['a[@]', 'A B', 'C']\n" Got ''
[dash status] Expected 0, got 2

stdout:
stderr: 
dash: 1: typeset: not found
dash: 2: Syntax error: "(" unexpected
ash27 a[@] in nameref

[ash stdout] Expected "['ref', 'A B', 'C']\nstatus=1\n['ref[@]']\n['ref', 'A B', 'C']\n['a[@]', 'A B', 'C']\n" Got ''
[ash status] Expected 0, got 2

stdout:
stderr: 
ash: typeset: not found
ash: syntax error: unexpected "("
zsh27 a[@] in nameref

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

stdout:
['ref', '']
status=0
['ref[@]', 'X', 'Y', 'Z']
['ref', 'X Y Z']
['a[@]', 'A B', 'C']
stderr:
zsh: bad option: -n
mksh27 a[@] in nameref

stdout:
stderr: 
mksh: <stdin>[3]: @: unexpected '@'
ksh27 a[@] in nameref

[ksh stdout] Expected "['ref', 'A B', 'C']\nstatus=1\n['ref[@]']\n['ref', 'A B', 'C']\n['a[@]', 'A B', 'C']\n" Got ''
[ksh status] Expected 0, got 1

stdout:
stderr: 
W: ksh: <stdin>[3]: @: unexpected '@'
toysh27 a[@] in nameref

[toysh stdout] Expected "['ref', 'A B', 'C']\nstatus=1\n['ref[@]']\n['ref', 'A B', 'C']\n['a[@]', 'A B', 'C']\n" Got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
sh: typeset: No such file or directory
main: line 2: sh: syntax error: 'A B'
sush27 a[@] in nameref

[sush 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['ref', 'X']\n['a[@]', 'A B', 'C']\n"

stdout:
['ref', 'a[@]']
status=0
['ref[@]', 'X', 'Y', 'Z']
['ref', 'X']
['a[@]', 'A B', 'C']
stderr:
brush27 a[@] in nameref

[brush 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['ref', 'X']\n['a[@]', 'A B', 'C']\n"

stdout:
['ref', 'a[@]']
status=0
['ref[@]', 'X', 'Y', 'Z']
['ref', 'X']
['a[@]', 'A B', 'C']
stderr:
osh27 a[@] in nameref

[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['ref', 'X']\n['a[@]', 'A B', 'C']\n"

stdout:
['ref', 'a[@]']
status=0
['ref[@]', 'X', 'Y', 'Z']
['ref', 'X']
['a[@]', 'A B', 'C']
stderr:
dash28 mutate through nameref: ref[0]=

[dash stdout] Expected 'xx Y Z\n', got ''
[dash status] Expected 0, got 2

stdout:
stderr: 
dash: 1: Syntax error: "(" unexpected
ash28 mutate through nameref: ref[0]=

[ash stdout] Expected 'xx Y Z\n', got ''
[ash status] Expected 0, got 2

stdout:
stderr: 
ash: syntax error: unexpected "("
zsh28 mutate through nameref: ref[0]=

[zsh stdout] Expected 'xx Y Z\n', got ''
[zsh status] Expected 0, got 1

stdout:
stderr: 
zsh: bad option: -n
zsh: ref: assignment to invalid subscript range
toysh28 mutate through nameref: ref[0]=

[toysh stdout] Expected 'xx Y Z\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: X
sush28 mutate through nameref: ref[0]=

[sush stdout] Expected 'xx Y Z\n', got 'X Y Z\n'

stdout:
X Y Z
stderr:
brush28 mutate through nameref: ref[0]=

[brush stdout] Expected 'xx Y Z\n', got 'X Y Z\n'

stdout:
X Y Z
stderr:
dash29 bad mutation through nameref: ref[0]= where ref is array[0]

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

stdout:
stderr: 
dash: 1: Syntax error: "(" unexpected
ash29 bad mutation through nameref: ref[0]= where ref is array[0]

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

stdout:
stderr: 
ash: syntax error: unexpected "("
zsh29 bad mutation through nameref: ref[0]= where ref is array[0]

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

stdout:
stderr: 
zsh: bad option: -n
zsh: ref: assignment to invalid subscript range
mksh29 bad mutation through nameref: ref[0]= where ref is array[0]

stdout:
status=0
foo Y Z
stderr:
ksh29 bad mutation through nameref: ref[0]= where ref is array[0]

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

stdout:
status=0
foo Y Z
stderr:
toysh29 bad mutation through nameref: ref[0]= where ref is array[0]

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

stdout:
stderr: 
main: line 1: sh: syntax error: X
sush29 bad mutation through nameref: ref[0]= where ref is array[0]

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

stdout:
status=0
X Y Z
stderr:
brush29 bad mutation through nameref: ref[0]= where ref is array[0]

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

stdout:
status=0
X Y Z
stderr:
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
bash30 @ in nameref isn't supported, unlike in ${!ref}

stdout:
status=1
ref=
status=0
stderr:
bash: line 2: typeset: `@': invalid variable name for name reference
dash30 @ in nameref isn't supported, unlike in ${!ref}

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

stdout:
status=127
ref=
status=0
stderr:
dash: 2: typeset: not found
ash30 @ in nameref isn't supported, unlike in ${!ref}

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

stdout:
status=127
ref=
status=0
stderr:
ash: typeset: not found
zsh30 @ in nameref isn't supported, unlike in ${!ref}

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

stdout:
status=1
ref=
status=0
stderr:
zsh: bad option: -n
ksh30 @ in nameref isn't supported, unlike in ${!ref}

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

stdout:
status=1
ref=
status=0
stderr:
E: ksh: <stdin>[2]: typeset: ref=@: empty nameref target
toysh30 @ in nameref isn't supported, unlike in ${!ref}

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

stdout:
status=127
ref=
status=0
stderr:
set: bad --
sh: typeset: No such file or directory
sush30 @ in nameref isn't supported, unlike in ${!ref}

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

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

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

stdout:
status=0
ref=@
status=0
stderr:
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:
dash31 Unquoted assoc reference on RHS

[dash stdout] Expected "['bar']\n", got ''
[dash status] Expected 0, got 2

stdout:
stderr: 
dash: 1: typeset: not found
dash: 2: bashup_ev_r[foo]=bar: not found
dash: 6: local: -n: bad variable name
ash31 Unquoted assoc reference on RHS

[ash stdout] Expected "['bar']\n", got ''
[ash status] Expected 0, got 2

stdout:
stderr: 
ash: typeset: not found
ash: bashup_ev_r[foo]=bar: not found
ash: local: line 6: -n: bad variable name
zsh31 Unquoted assoc reference on RHS

[zsh stdout] Expected "['bar']\n", got "['']\n"

stdout:
['']
stderr:
p:2: bad option: -n
mksh31 Unquoted assoc reference on RHS

stdout:
stderr: 
mksh: <stdin>[1]: typeset: -A: unknown option
mksh: <stdin>[2]: 'foo': multi-character character constant
ksh31 Unquoted assoc reference on RHS

[ksh stdout] Expected "['bar']\n", got ''
[ksh status] Expected 0, got 1

stdout:
stderr: 
E: ksh: <stdin>[1]: typeset: -A: unknown option
W: ksh: <stdin>[2]: 'foo': multi-character character constant
toysh31 Unquoted assoc reference on RHS

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

stdout:
['bashup_ev_r[foo]']
stderr:
sh: typeset: No such file or directory
sh: bashup_ev_r[foo]=bar: No such file or directory
local: bad -n
sush31 Unquoted assoc reference on RHS

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

stdout:
['bashup_ev_r[foo]']
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 2: 'foo': syntax error: operand expected (error token is "'foo'")
brush31 Unquoted assoc reference on RHS

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

stdout:
['bashup_ev_r[foo]']
stderr:
osh31 Unquoted assoc reference on RHS

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

stdout:
['bashup_ev_r[foo]']
stderr: