Results for assign-extended.test.sh

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

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 (OILS-ERR-100)
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 -F with shopt -s extdebug prints more info

stdout:
stderr: 
osh5 declare -F with shopt -s extdebug prints more info

[osh stdout] Expected 'declare -f add\ndeclare -f g\n\nadd 7 main\ng 3 ROOT/spec/testdata/bash-source-2.sh\n' Got 'declare -f add\ndeclare -f g\n\nadd\ng\n'

stdout:
declare -f add
declare -f g

add
g
stderr:
  shopt -s extdebug
  ^~~~~
[ stdin ]:5: 'shopt' got invalid option 'extdebug'
mksh6 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
bash-47 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:
mksh7 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
bash-48 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:
mksh8 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
bash-49 declare -p doesn't print binary data, but can be loaded into bash

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

stdout:
stderr: 
bash-410 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
mksh10 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
bash-411 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:
mksh11 declare -p arr

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

stdout:
stderr: 
bash-413 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:
mksh13 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
bash-414 declare -paA

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

stdout:
stderr: 
mksh: <stdin>[1]: syntax error: '(' unexpected
bash-415 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
mksh15 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
bash-416 declare -pg

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

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

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

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

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

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

stdout:
0
0
0
stderr:
bash-422 typeset -r makes a string readonly

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

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

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

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

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

stdout:
1
2
3
stderr:
bash-427 syntax error in array assignment

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

stdout:
stderr: 
mksh: <stdin>[1]: 0+: unexpected 'end of expression'
mksh28 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 '"'
osh29 myvar=typeset (another form of dynamic assignment)

stdout:
a b
stderr:
bash-430 dynamic array parsing is not allowed

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

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

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

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

stdout:
status=127
stderr:
mksh: <stdin>[2]: declare: not found
mksh36 unset and shell funcs

stdout:
bar
bar
stderr:
mksh: <stdin>[7]: declare: not found
mksh: <stdin>[9]: declare: not found