Results for array.test.sh

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

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[2]: syntax error: '(' unexpected
mksh9 space before ( in array initialization

stdout:
1
stderr:
mksh11 array with invalid token

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[3]: syntax error: '&' unexpected
mksh15 Negative index

stdout:
['', '', '']
stderr:
mksh21 ${!a[1]} is named ref in bash

stdout:
['a[1]']
stderr:
bash22 ${!a} on array is disallowed

stdout:
['']
stderr:
mksh22 ${!a} on array is disallowed

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

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

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

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[1]: syntax error: '(' unexpected
bash33 Set array item to array

stdout:
status=1
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/bash: line 2: a[0]: cannot assign list to array member
mksh33 Set array item to array

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[2]: set: a[0]: is not an identifier
mksh34 Slice of array with [@]

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[2]: ${a[@]: 1:2}: bad substitution
mksh35 Negative slice begin

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[2]: ${a[@]: (-4)}: bad substitution
mksh37 Slice with arithmetic

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[3]: ${a[@]:i-4:2}: bad substitution
bash43 Array syntax in wrong place

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/bash: line 1: syntax error near unexpected token `('
/home/andy/git/oilshell/oil/_tmp/spec-bin/bash: line 1: `ls foo=(1 2)'
bash44 Single array with :-

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

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

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

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[2]: ${files[@]%.c}: bad substitution
mksh46 Stripping a whole array quoted

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[2]: ${files[@]%.c}: bad substitution
bash47 Multiple subscripts not allowed

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/bash: line 2: ${a[0][0]}: bad substitution
mksh47 Multiple subscripts not allowed

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[2]: ${a[0][0]}: bad substitution
bash48 Length op, index op, then transform op is not allowed

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/bash: line 2: ${#a[0]/1/xxx}: bad substitution
mksh48 Length op, index op, then transform op is not allowed

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[2]: ${#a[0]/1/xxx}: bad substitution
bash49 Array subscript not allowed on string

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

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

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

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

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[4]: ${a[@]: 15:2}: bad substitution
bash60 Using an array itself as the index on LHS

stdout:
['42', '99', '42', '99', '']
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/bash: line 1: shopt: strict-arith: invalid shell option name
mksh60 Using an array itself as the index on LHS

stdout:
['42', '99', '42', '99', '']
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[1]: shopt: not found
bash61 Using an array itself as the index on RHS

stdout:
2
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/bash: line 1: shopt: strict-arith: invalid shell option name
mksh61 Using an array itself as the index on RHS

stdout:
2
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[1]: shopt: not found