append () { run-file append "$@" } run-file () { local spec_name=$1; shift; sh-spec spec/$spec_name.test.sh --compare-shells --oils-bin-dir $PWD/bin "$@" } append: spec test case results

Results for append.test.sh

statusbashmkshzshosh
pass 1212919
ok 3130
N-I 1350
BUG 3320
total19191919
casebashmkshzshoshdescription
0pass pass pass pass Append string to string
1pass pass pass pass Append array to array
2pass pass pass pass Append string to undefined variable
3pass pass pass pass Append to array to undefined variable
4BUG BUG ok pass error: s+=(my array)
detailsdetailsdetails
5ok ok ok pass error: myarray+=s
detailsdetailsdetails
6ok pass pass pass typeset s+=(my array)
details
7BUG N-I pass pass error: typeset myarray+=s
detailsdetails
8BUG BUG BUG pass error: append used like env prefix
detailsdetailsdetails
9pass pass BUG pass myarray[1]+=s - Append to element
details
10pass BUG pass pass myarray[-1]+=s - Append to last element
details
11ok N-I ok pass Try to append list to element
detailsdetailsdetails
12pass pass pass pass Strings have value semantics, not reference semantics
13pass pass N-I pass typeset s+=
details
14pass pass N-I pass typeset s${dyn}+=
details
15pass pass N-I pass export readonly +=
details
16pass pass N-I pass local +=
details
17pass N-I N-I pass assign builtin appending array: declare d+=(d e)
detailsdetails
18N-I pass pass pass export+=array disallowed (strict_array)
details
52 passed, 7 OK, 9 not implemented, 8 BUG, 0 failed, 0 timeouts, 0 cases skipped

Details on runs that didn't PASS

bash4 error: s+=(my array)

stdout:
abc
stderr:
mksh4 error: s+=(my array)

stdout:
abc
stderr:
zsh4 error: s+=(my array)

stdout:
abc d e f
stderr:
bash5 error: myarray+=s

stdout:
['xz', 'y']
stderr:
mksh5 error: myarray+=s

stdout:
['xz', 'y']
stderr:
zsh5 error: myarray+=s

stdout:
['x', 'y', 'z']
stderr:
bash6 typeset s+=(my array)

stdout:
abc
status=0
['abc', 'd', 'e', 'f']
stderr:
bash7 error: typeset myarray+=s

stdout:
['x', 'y']
['xs', 'y']
stderr:
mksh7 error: typeset myarray+=s

stdout:
stderr: 
mksh: <stdin>[1]: syntax error: '(' unexpected
bash8 error: append used like env prefix

stdout:
aa
stderr:
mksh8 error: append used like env prefix

stdout:
a
stderr:
zsh8 error: append used like env prefix

stdout:
aa
stderr:
zsh9 myarray[1]+=s - Append to element

stdout:
['xz', 'y']
stderr:
mksh10 myarray[-1]+=s - Append to last element

stdout:
['1', '2 3', ' 4']
stderr:
bash11 Try to append list to element

stdout:
['1', '2 3']
stderr:
bash: line 2: a[-1]: cannot assign list to array member
mksh11 Try to append list to element

stdout:
stderr: 
mksh: <stdin>[2]: set: a[-1]+: is not an identifier
zsh11 Try to append list to element

stdout:
['1', '2 3', '4', '5']
stderr:
zsh13 typeset s+=

stdout:
stderr: 
typeset: not valid in this context: s+
zsh14 typeset s${dyn}+=

stdout:
stderr: 
typeset: not valid in this context: sx+
zsh15 export readonly +=

stdout:
stderr: 
export: not valid in this context: e+
zsh16 local +=

stdout:
stderr: 
f:local:1: not valid in this context: s+
mksh17 assign builtin appending array: declare d+=(d e)

stdout:
stderr: 
mksh: <stdin>[1]: syntax error: '(' unexpected
zsh17 assign builtin appending array: declare d+=(d e)

stdout:
stderr: 
declare: not valid in this context: d+
bash18 export+=array disallowed (strict_array)

stdout:
e x
stderr:
bash: line 1: shopt: strict_array: invalid shell option name