Results for assign-extended.test.sh

statusbash-4mkshosh
pass 20834
ok 951
N-I 4211
BUG 310
FAIL 010
total363636
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 pass declare -p var (exit status)
details
6ok N-I pass declare
detailsdetails
7BUG N-I pass declare -p
detailsdetails
8N-I N-I pass declare -p doesn't print binary data, but can be loaded into bash
detailsdetails
9BUG N-I pass declare -p var
detailsdetails
10ok N-I pass declare -p arr
detailsdetails
11pass N-I pass declare -p foo=bar doesn't make sense
details
12ok N-I pass declare -pnrx
detailsdetails
13ok N-I pass declare -paA
detailsdetails
14N-I N-I pass declare -pnrx var
detailsdetails
15N-I N-I pass declare -pg
detailsdetails
16N-I N-I pass declare -pg var
detailsdetails
17pass N-I pass ble.sh: eval -- "$(declare -p var arr)"
details
18pass N-I pass eval -- "$(declare -p arr)" (restore arrays w/ unset elements)
details
19pass pass pass typeset -f
20pass BUG pass typeset -p
details
21ok ok pass typeset -r makes a string readonly
detailsdetails
22ok N-I pass typeset -ar makes it readonly
detailsdetails
23pass pass pass typeset -x makes it exported
24pass pass pass Multiple assignments / array assignments on a line
25ok ok pass Env bindings shouldn't contain array assignments
detailsdetails
26BUG ok pass syntax error in array assignment
detailsdetails
27pass N-I pass declare -g (bash-specific; bash-completion uses it)
details
28pass pass ok myvar=typeset (another form of dynamic assignment)
details
29ok ok pass dynamic array parsing is not allowed
detailsdetails
30pass pass pass dynamic flag in array in assign builtin
31pass pass pass typeset +x
32ok ok pass typeset +r removes read-only attribute (TODO: documented in bash to do nothing)
detailsdetails
33pass N-I pass function name with /
details
34pass pass pass invalid var name
35pass FAIL pass unset and shell funcs
details
62 passed, 15 OK, 26 not implemented, 4 BUG, 1 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 (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 -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-46 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
bash-47 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
bash-48 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: 
bash-49 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
bash-410 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: 
bash-412 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
bash-413 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
bash-414 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
bash-415 declare -pg

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

stdout:
stderr: 
mksh: <stdin>[8]: declare: not found
bash-416 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:
bash-421 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
mksh21 typeset -r makes a string readonly

stdout:
stderr: 
mksh: <stdin>[4]: read-only: s1
bash-422 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
mksh22 typeset -ar makes it readonly

stdout:
stderr: 
mksh: <stdin>[1]: syntax error: '(' unexpected
bash-425 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:
bash-426 syntax error in array assignment

stdout:
x
stderr:
bash-4.4: 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:
bash-429 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:
bash-432 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
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
mksh35 unset and shell funcs

[mksh stdout] Expected 'bar\ndeclare -f foo\n', got 'bar\nbar\n'
[mksh status] Expected 127, got 0

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