Results for array.test.sh

statusbashmkshoshosh_ALT
pass 59456767
ok 7711
N-I 0900
BUG 2700
total68686868
casebashmkshoshosh_ALTdescription
0pass pass pass pass SETUP
1pass pass pass pass "${a[@]}" and "${a[*]}"
2pass pass pass pass ${a[@]} and ${a[*]}
3pass pass pass pass 4 ways to interpolate empty array
4pass pass pass pass empty array
5pass pass pass pass Empty array with :-
6pass BUG pass pass nounset with empty array (design bug, makes it hard to use arrays)
details
7pass BUG pass pass local array
details
8pass pass pass pass Command with with word splitting in array
9pass ok pass pass space before ( in array initialization
details
10pass pass pass pass array over multiple lines
11pass ok pass pass array with invalid token
details
12pass pass pass pass array with empty string
13pass pass pass pass Retrieve index
14pass pass pass pass Retrieve out of bounds index
15pass N-I pass pass Negative index
details
16pass BUG pass pass Negative index and sparse array
details
17pass BUG pass pass Negative index and sparse array
details
18pass BUG pass pass Length after unset
details
19pass pass pass pass Retrieve index that is a variable
20pass pass pass pass Retrieve index that is a variable without $
21pass pass pass pass Retrieve index that is a command sub
22pass pass pass pass Retrieve array indices with ${!a}
23pass pass pass pass Retrieve sparse array indices with ${!a}
24pass N-I pass pass ${!a[1]} is named ref in bash
details
25pass BUG pass pass ${!a} on array
details
26pass pass pass pass All elements unquoted
27pass pass pass pass All elements quoted
28pass pass pass pass $*
29pass pass pass pass "$*"
30pass pass pass pass Interpolate array into array
31ok pass pass pass Exporting array doesn't do anything, not even first element
details
32ok ok pass pass Arrays can't be used as env bindings
detailsdetails
33pass pass pass pass Set element
34pass pass pass pass Set element with var ref
35pass pass pass pass Set element with array ref
36BUG N-I pass pass Set array item to array
detailsdetails
37pass N-I pass pass Slice of array with [@]
details
38pass N-I pass pass Negative slice begin
details
39pass pass pass pass Negative slice length
40pass N-I pass pass Slice with arithmetic
details
41pass pass pass pass Number of elements
42pass pass pass pass Length of an element
43pass pass pass pass Iteration
44pass pass pass pass glob within array yields separate elements
45pass pass pass pass declare array and then append
46ok pass pass pass Array syntax in wrong place
details
47ok ok ok ok Single array with :-
detailsdetailsdetailsdetails
48pass N-I pass pass Stripping a whole array unquoted
details
49pass N-I pass pass Stripping a whole array quoted
details
50ok ok pass pass Multiple subscripts not allowed
detailsdetails
51ok ok pass pass Length op, index op, then transform op is not allowed
detailsdetails
52BUG BUG pass pass Array subscript not allowed on string
detailsdetails
53pass pass pass pass Create a "user" array out of the argv array
54pass pass pass pass Tilde expansion within array
55pass pass pass pass Brace Expansion within Array
56pass pass pass pass array default
57ok ok pass pass Singleton Array Copy and Assign. OSH can't index strings with ints
detailsdetails
58pass pass pass pass declare -a / local -a is empty array
59pass pass pass pass Create sparse array
60pass pass pass pass Create sparse array implicitly
61pass pass pass pass Append sparse arrays
62pass N-I pass pass Slice of sparse array with [@]
details
63pass pass pass pass Using an array itself as the index on LHS
64pass pass pass pass Using an array itself as the index on RHS
65pass pass pass pass a[$x$y] on LHS and RHS
66pass pass pass pass Dynamic parsing of LHS a[$code]=value
67pass pass pass pass Dynamic parsing of RHS ${a[$code]}
238 passed, 16 OK, 9 not implemented, 9 BUG, 0 failed, 0 timeouts, 0 cases skipped

Details on runs that didn't PASS

mksh6 nounset with empty array (design bug, makes it hard to use arrays)

stdout:
stderr: 
mksh: <stdin>[3]: empty[@]: parameter not set
mksh7 local array

stdout:
stderr: 
mksh: <stdin>[2]: syntax error: '(' unexpected
mksh9 space before ( in array initialization

stdout:
1
stderr:
mksh11 array with invalid token

stdout:
stderr: 
mksh: <stdin>[3]: syntax error: '&' unexpected
mksh15 Negative index

stdout:
['', '', '']
stderr:
mksh16 Negative index and sparse array

stdout:
0 2 3
-1
-2
-3
-4
-5
0 2 3 0
0 2 3 42
stderr:
mksh17 Negative index and sparse array

stdout:
0 0
1 1
2 2
3 3
stderr:
mksh18 Length after unset

stdout:
len=4
len=4
stderr:
mksh24 ${!a[1]} is named ref in bash

stdout:
['a[1]']
stderr:
mksh25 ${!a} on array

stdout:
['a']
stderr:
bash31 Exporting array doesn't do anything, not even first element

stdout:
None
stderr:
bash32 Arrays can't be used as env bindings

stdout:
a
(b b)
stderr:
mksh32 Arrays can't be used as env bindings

stdout:
stderr: 
mksh: <stdin>[1]: syntax error: '(' unexpected
bash36 Set array item to array

stdout:
status=1
stderr:
bash: line 2: a[0]: cannot assign list to array member
mksh36 Set array item to array

stdout:
stderr: 
mksh: <stdin>[2]: set: a[0]: is not an identifier
mksh37 Slice of array with [@]

stdout:
stderr: 
mksh: <stdin>[2]: ${a[@]: 1:2}: bad substitution
mksh38 Negative slice begin

stdout:
stderr: 
mksh: <stdin>[2]: ${a[@]: (-4)}: bad substitution
mksh40 Slice with arithmetic

stdout:
stderr: 
mksh: <stdin>[3]: ${a[@]:i-4:2}: bad substitution
bash46 Array syntax in wrong place

stdout:
stderr: 
bash: line 1: syntax error near unexpected token `('
bash: line 1: `ls foo=(1 2)'
bash47 Single array with :-

stdout:
['none', 'x', '']
stderr:
mksh47 Single array with :-

stdout:
['none', 'x', 'none']
stderr:
osh47 Single array with :-

stdout:
['x', '']
stderr:
osh_ALT47 Single array with :-

stdout:
['x', '']
stderr:
mksh48 Stripping a whole array unquoted

stdout:
stderr: 
mksh: <stdin>[2]: ${files[@]%.c}: bad substitution
mksh49 Stripping a whole array quoted

stdout:
stderr: 
mksh: <stdin>[2]: ${files[@]%.c}: bad substitution
bash50 Multiple subscripts not allowed

stdout:
stderr: 
bash: line 2: ${a[0][0]}: bad substitution
mksh50 Multiple subscripts not allowed

stdout:
stderr: 
mksh: <stdin>[2]: ${a[0][0]}: bad substitution
bash51 Length op, index op, then transform op is not allowed

stdout:
stderr: 
bash: line 2: ${#a[0]/1/xxx}: bad substitution
mksh51 Length op, index op, then transform op is not allowed

stdout:
stderr: 
mksh: <stdin>[2]: ${#a[0]/1/xxx}: bad substitution
bash52 Array subscript not allowed on string

stdout:
abc
stderr:
mksh52 Array subscript not allowed on string

stdout:
abc
stderr:
bash57 Singleton Array Copy and Assign. OSH can't index strings with ints

stdout:
4 4
1 1
4 4
1 1
stderr:
mksh57 Singleton Array Copy and Assign. OSH can't index strings with ints

stdout:
4 4
1 1
4 4
1 1
stderr:
mksh62 Slice of sparse array with [@]

stdout:
stderr: 
mksh: <stdin>[4]: ${a[@]: 15:2}: bad substitution