Results for assign-extended.test.sh

statusbashmkshoshosh_ALT
pass 1983333
ok 9511
N-I 42111
BUG 3100
total35353535
casebashmkshoshosh_ALTdescription
0pass N-I pass pass local -a
details
1pass N-I pass pass declare -a
details
2pass pass N-I N-I indexed LHS with spaces (not allowed in OSH)
detailsdetails
3pass N-I pass pass declare -f exit code indicates function existence
details
4pass N-I pass pass declare -F prints function names
details
5pass N-I pass pass declare -p var (exit status)
details
6ok N-I pass pass declare
detailsdetails
7BUG N-I pass pass declare -p
detailsdetails
8N-I N-I pass pass declare -p doesn't print binary data, but can be loaded into bash
detailsdetails
9BUG N-I pass pass declare -p var
detailsdetails
10ok N-I pass pass declare -p arr
detailsdetails
11pass N-I pass pass declare -p foo=bar doesn't make sense
details
12ok N-I pass pass declare -pnrx
detailsdetails
13ok N-I pass pass declare -paA
detailsdetails
14N-I N-I pass pass declare -pnrx var
detailsdetails
15N-I N-I pass pass declare -pg
detailsdetails
16N-I N-I pass pass declare -pg var
detailsdetails
17pass N-I pass pass ble.sh: eval -- "$(declare -p var arr)"
details
18pass N-I pass pass eval -- "$(declare -p arr)" (restore arrays w/ unset elements)
details
19pass pass pass pass typeset -f
20pass BUG pass pass typeset -p
details
21ok ok pass pass typeset -r makes a string readonly
detailsdetails
22ok N-I pass pass typeset -ar makes it readonly
detailsdetails
23pass pass pass pass typeset -x makes it exported
24pass pass pass pass Multiple assignments / array assignments on a line
25ok ok pass pass Env bindings shouldn't contain array assignments
detailsdetails
26BUG ok pass pass syntax error in array assignment
detailsdetails
27pass N-I pass pass declare -g (bash-specific; bash-completion uses it)
details
28pass pass ok ok myvar=typeset (another form of dynamic assignment)
detailsdetails
29ok ok pass pass dynamic array parsing is not allowed
detailsdetails
30pass pass pass pass dynamic flag in array in assign builtin
31pass pass pass pass typeset +x
32ok ok pass pass typeset +r removes read-only attribute (TODO: documented in bash to do nothing)
detailsdetails
33pass N-I pass pass function name with /
details
34pass pass pass pass invalid var name
93 passed, 16 OK, 27 not implemented, 4 BUG, 0 failed, 0 timeouts, 0 cases skipped

Details on runs that didn't PASS

mksh0 local -a

stdout:
stderr: 
mksh: <stdin>[2]: syntax error: '(' unexpected
mksh1 declare -a

stdout:
stderr: 
mksh: <stdin>[1]: syntax error: '(' unexpected
osh2 indexed LHS with spaces (not allowed in OSH)

stdout:
status=127
[]
stderr:
  a[1 * 1]=x a[ 1 + 2 ]=z
  ^~
[ stdin ]:1: 'a[1' not found
osh_ALT2 indexed LHS with spaces (not allowed in OSH)

stdout:
status=127
[]
stderr:
  a[1 * 1]=x a[ 1 + 2 ]=z
  ^~
[ stdin ]:1: 'a[1' not found
mksh3 declare -f exit code indicates function existence

stdout:
127
127
127
stderr:
mksh: <stdin>[2]: declare: not found
mksh: <stdin>[6]: declare: not found
mksh: <stdin>[10]: declare: not found
mksh4 declare -F prints function names

stdout:
stderr: 
mksh: <stdin>[7]: declare: not found
mksh5 declare -p var (exit status)

stdout:
127
127
127
stderr:
mksh: <stdin>[2]: declare: not found
mksh: <stdin>[6]: declare: not found
mksh: <stdin>[10]: declare: not found
bash6 declare

stdout:
[declare]
test_var1=111
test_var2=222
test_var3=333
test_var4=test_var1
test_var5=555
[readonly]
declare -r test_var2="222"
[export]
declare -x test_var3="333"
[local]
test_var5=555
stderr:
mksh6 declare

stdout:
[declare]
[readonly]
test_var2
[export]
test_var3
[local]
typeset test_var1
typeset -r test_var2
typeset -x test_var3
typeset test_var5
stderr:
mksh: <stdin>[4]: declare: not found
mksh: <stdin>[18]: declare: not found
bash7 declare -p

stdout:
[declare]
declare -- test_var1="111"
declare -r test_var2="222"
declare -x test_var3="333"
declare -n test_var4="test_var1"
declare -- test_var5="555"
[readonly]
declare -r test_var2="222"
[export]
declare -x test_var3="333"
[local]
test_var5=555
stderr:
mksh7 declare -p

stdout:
[declare]
[readonly]
readonly test_var2=222
[export]
export test_var3=333
[local]
typeset test_var1=111
typeset -r test_var2=222
typeset -x test_var3=333
typeset test_var5=555
stderr:
mksh: <stdin>[4]: declare: not found
mksh: <stdin>[18]: declare: not found
bash8 declare -p doesn't print binary data, but can be loaded into bash

stdout:
stderr: 
mksh8 declare -p doesn't print binary data, but can be loaded into bash

stdout:
stderr: 
bash9 declare -p var

stdout:
[declare]
declare -- test_var1="111"
declare -r test_var2="222"
declare -x test_var3="333"
declare -n test_var4="test_var1"
declare -- test_var5="555"
[readonly]
[export]
[local]
stderr:
main: line 9: declare: test_var0: not found
main: line 15: local: test_var0: readonly variable
main: line 15: local: test_var1: readonly variable
main: line 15: local: test_var2: readonly variable
main: line 15: local: test_var3: readonly variable
mksh9 declare -p var

stdout:
[declare]
[readonly]
stderr:
mksh: <stdin>[4]: declare: not found
mksh: <stdin>[18]: declare: not found
mksh: <stdin>[18]: readonly: test_var{0..5}: is not an identifier
bash10 declare -p arr

stdout:
declare -a test_arr1=()
declare -a test_arr2=()
declare -A test_arr3=()
declare -a test_arr4=([0]="1" [1]="2" [2]="3")
declare -a test_arr5=([0]="1" [1]="2" [2]="3")
declare -A test_arr6=([a]="1" [b]="2" [c]="3" )
declare -a test_arr7=([3]="foo")
stderr:
mksh10 declare -p arr

stdout:
stderr: 
mksh: <stdin>[2]: syntax error: '(' unexpected
mksh11 declare -p foo=bar doesn't make sense

stdout:
stderr: 
bash12 declare -pnrx

stdout:
[declare -pn]
declare -n test_var4="test_var1"
[declare -pr]
declare -r test_var2="222"
[declare -px]
declare -x test_var3="333"
stderr:
mksh12 declare -pnrx

stdout:
[declare -pn]
[declare -pr]
[declare -px]
stderr:
mksh: <stdin>[4]: declare: not found
mksh: <stdin>[16]: declare: not found
mksh: <stdin>[16]: declare: not found
mksh: <stdin>[16]: declare: not found
bash13 declare -paA

stdout:
[declare -pa]
declare -a test_var6=()
[declare -pA]
declare -A test_var7=()
stderr:
mksh13 declare -paA

stdout:
stderr: 
mksh: <stdin>[1]: syntax error: '(' unexpected
bash14 declare -pnrx var

stdout:
[declare -pn]
declare -- test_var1="111"
declare -r test_var2="222"
declare -x test_var3="333"
declare -n test_var4="test_var1"
declare -- test_var5="555"
[declare -pr]
declare -- test_var1="111"
declare -r test_var2="222"
declare -x test_var3="333"
declare -n test_var4="test_var1"
declare -- test_var5="555"
[declare -px]
declare -- test_var1="111"
declare -r test_var2="222"
declare -x test_var3="333"
declare -n test_var4="test_var1"
declare -- test_var5="555"
stderr:
main: line 9: declare: test_var0: not found
main: line 11: declare: test_var0: not found
main: line 13: declare: test_var0: not found
mksh14 declare -pnrx var

stdout:
[declare -pn]
[declare -pr]
[declare -px]
stderr:
mksh: <stdin>[4]: declare: not found
mksh: <stdin>[16]: declare: not found
mksh: <stdin>[16]: declare: not found
mksh: <stdin>[16]: declare: not found
bash15 declare -pg

stdout:
declare -- test_var1="local"
stderr:
mksh15 declare -pg

stdout:
stderr: 
mksh: <stdin>[8]: declare: not found
bash16 declare -pg var

stdout:
declare -- test_var1="local"
stderr:
mksh16 declare -pg var

stdout:
stderr: 
mksh: <stdin>[8]: declare: not found
mksh17 ble.sh: eval -- "$(declare -p var arr)"

stdout:
stderr: 
mksh: <stdin>[3]: syntax error: '(' unexpected
mksh18 eval -- "$(declare -p arr)" (restore arrays w/ unset elements)

stdout:
stderr: 
mksh: <stdin>[2]: declare: not found
mksh: <stdin>[5]: {0..4}: unexpected '{'
mksh20 typeset -p

stdout:
0
0
0
stderr:
bash21 typeset -r makes a string readonly

stdout:
status=1
status=1
status=1
status=1
status=1
status=1
stderr:
bash: line 4: s1: readonly variable
bash: line 6: s2: readonly variable
bash: line 9: s1: readonly variable
bash: line 11: s2: readonly variable
bash: line 14: unset: s1: cannot unset: readonly variable
bash: line 16: unset: s2: cannot unset: readonly variable
mksh21 typeset -r makes a string readonly

stdout:
stderr: 
mksh: <stdin>[4]: read-only: s1
bash22 typeset -ar makes it readonly

stdout:
status=1
status=1
status=1
status=1
status=1
status=1
stderr:
bash: line 4: array1: readonly variable
bash: line 6: array2: readonly variable
bash: line 9: array1: readonly variable
bash: line 11: array2: readonly variable
bash: line 14: unset: array1: cannot unset: readonly variable
bash: line 16: unset: array2: cannot unset: readonly variable
mksh22 typeset -ar makes it readonly

stdout:
stderr: 
mksh: <stdin>[1]: syntax error: '(' unexpected
bash25 Env bindings shouldn't contain array assignments

stdout:
1
None
3
stderr:
mksh25 Env bindings shouldn't contain array assignments

stdout:
1
2
3
stderr:
bash26 syntax error in array assignment

stdout:
x
stderr:
bash: line 1: 0+: syntax error: operand expected (error token is "+")
mksh26 syntax error in array assignment

stdout:
stderr: 
mksh: <stdin>[1]: 0+: unexpected 'end of expression'
mksh27 declare -g (bash-specific; bash-completion uses it)

stdout:
['', '']
stderr:
mksh: <stdin>[14]: declare: not found
mksh: <stdin>[14]: declare: not found
mksh: <stdin>[14]: declare: not found
mksh: <stdin>[14]: "foo": unexpected '"'
mksh: <stdin>[16]: "foo": unexpected '"'
osh28 myvar=typeset (another form of dynamic assignment)

stdout:
a b
stderr:
osh_ALT28 myvar=typeset (another form of dynamic assignment)

stdout:
a b
stderr:
bash29 dynamic array parsing is not allowed

stdout:
status=0
['1']
stderr:
mksh29 dynamic array parsing is not allowed

stdout:
status=0
['(1 2 3)']
stderr:
bash32 typeset +r removes read-only attribute (TODO: documented in bash to do nothing)

stdout:
r=r1
r=r1
r=r1
stderr:
bash: line 4: typeset: r: readonly variable
bash: line 7: r: readonly variable
mksh32 typeset +r removes read-only attribute (TODO: documented in bash to do nothing)

stdout:
r=r1
stderr:
mksh: <stdin>[4]: read-only: r
mksh33 function name with /

stdout:
status=127
stderr:
mksh: <stdin>[2]: declare: not found