Results for assign-extended.test.sh

casebashmkshoshosh_ALTdescription
0pass N-I pass pass local -a
details
1pass N-I pass pass declare -a
details
2pass pass pass pass typeset -a a[1]=a a[3]=c
3pass pass FAIL FAIL indexed LHS without spaces is allowed
detailsdetails
4pass N-I pass pass declare -f exit code indicates function existence
details
5pass N-I pass pass declare -F prints function names
details
6pass N-I pass pass declare -p
details
7pass pass pass pass typeset -f
8pass BUG pass pass typeset -p
details
9ok ok pass pass typeset -r makes a string readonly
detailsdetails
10ok N-I pass pass typeset -ar makes it readonly
detailsdetails
11pass pass pass pass typeset -x makes it exported
12pass pass pass pass Multiple assignments / array assignments on a line
13ok ok pass pass Env bindings shouldn't contain array assignments
detailsdetails
14BUG ok pass pass syntax error in array assignment
detailsdetails
15pass N-I pass pass declare -g (bash-specific; bash-completion uses it)
details
16pass pass FAIL FAIL myvar=typeset (another form of dynamic assignment)
detailsdetails

49 passed, 6 ok, 7 known unimplemented, 2 known bugs, 2 failed, 0 skipped

Details on runs that didn't PASS

mksh0 local -a

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

stdout:
stderr: 
_tmp/spec-bin/mksh: <stdin>[1]: syntax error: '(' unexpected
osh3 indexed LHS without spaces is allowed

[osh stdout] Expected "['x', 'z']\n", got '[]\n'

stdout:
[]
stderr:
  a[1 * 1]=x a[ 1 + 2 ]=z
  ^~
[ stdin ]:1: Can't execute 'a[1': No such file or directory
osh_ALT3 indexed LHS without spaces is allowed

[osh_ALT stdout] Expected "['x', 'z']\n", got '[]\n'

stdout:
[]
stderr:
  a[1 * 1]=x a[ 1 + 2 ]=z
  ^~
[ stdin ]:1: Can't execute 'a[1': No such file or directory
mksh4 declare -f exit code indicates function existence

stdout:
127
127
127
stderr:
_tmp/spec-bin/mksh: <stdin>[2]: declare: not found
_tmp/spec-bin/mksh: <stdin>[5]: declare: not found
_tmp/spec-bin/mksh: <stdin>[8]: declare: not found
mksh5 declare -F prints function names

stdout:
stderr: 
_tmp/spec-bin/mksh: <stdin>[6]: declare: not found
mksh6 declare -p

stdout:
127
127
127
stderr:
_tmp/spec-bin/mksh: <stdin>[2]: declare: not found
_tmp/spec-bin/mksh: <stdin>[5]: declare: not found
_tmp/spec-bin/mksh: <stdin>[8]: declare: not found
mksh8 typeset -p

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

stdout:
status=1
status=1
status=1
status=1
status=1
status=1
stderr:
_tmp/spec-bin/bash: line 3: s1: readonly variable
_tmp/spec-bin/bash: line 5: s2: readonly variable
_tmp/spec-bin/bash: line 7: s1: readonly variable
_tmp/spec-bin/bash: line 9: s2: readonly variable
_tmp/spec-bin/bash: line 11: unset: s1: cannot unset: readonly variable
_tmp/spec-bin/bash: line 13: unset: s2: cannot unset: readonly variable
mksh9 typeset -r makes a string readonly

stdout:
stderr: 
_tmp/spec-bin/mksh: <stdin>[3]: read-only: s1
bash10 typeset -ar makes it readonly

stdout:
status=1
status=1
status=1
status=1
status=1
status=1
stderr:
_tmp/spec-bin/bash: line 3: array1: readonly variable
_tmp/spec-bin/bash: line 5: array2: readonly variable
_tmp/spec-bin/bash: line 7: array1: readonly variable
_tmp/spec-bin/bash: line 9: array2: readonly variable
_tmp/spec-bin/bash: line 11: unset: array1: cannot unset: readonly variable
_tmp/spec-bin/bash: line 13: unset: array2: cannot unset: readonly variable
mksh10 typeset -ar makes it readonly

stdout:
stderr: 
_tmp/spec-bin/mksh: <stdin>[1]: syntax error: '(' unexpected
bash13 Env bindings shouldn't contain array assignments

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

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

stdout:
x
stderr:
_tmp/spec-bin/bash: line 1: 0+: syntax error: operand expected (error token is "+")
mksh14 syntax error in array assignment

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

stdout:
['', '']
stderr:
_tmp/spec-bin/mksh: <stdin>[11]: declare: not found
_tmp/spec-bin/mksh: <stdin>[11]: declare: not found
_tmp/spec-bin/mksh: <stdin>[11]: declare: not found
_tmp/spec-bin/mksh: <stdin>[11]: "foo": unexpected '"'
_tmp/spec-bin/mksh: <stdin>[13]: "foo": unexpected '"'
osh16 myvar=typeset (another form of dynamic assignment)

[osh stdout] Expected '42\n', got '\n'

stdout:
stderr: 
  $myvar x=42
  ^~~~~~
[ stdin ]:2: 'typeset' doesn't understand ['x=42']
osh_ALT16 myvar=typeset (another form of dynamic assignment)

[osh_ALT stdout] Expected '42\n', got '\n'

stdout:
stderr: 
  $myvar x=42
  ^~~~~~
[ stdin ]:2: 'typeset' doesn't understand ['x=42']