Results for array.test.sh

statusoshosh-cpp
pass 6363
FAIL 44
total6767
caseoshosh-cppdescription
0pass pass nounset / set -u with empty array (bug in bash 4.3, fixed in 4.4)
1pass pass local array
2pass pass Command with with word splitting in array
3pass pass space before ( in array initialization
4pass pass array over multiple lines
5pass pass array with invalid token
6pass pass array with empty string
7pass pass Retrieve index
8pass pass Retrieve out of bounds index
9pass pass Negative index
10pass pass Negative index and sparse array
11pass pass Negative index and sparse array
12pass pass Length after unset
13pass pass Retrieve index that is a variable
14pass pass Retrieve index that is a variable without $
15pass pass Retrieve index that is a command sub
16pass pass Retrieve array indices with ${!a}
17pass pass Retrieve sparse array indices with ${!a}
18pass pass ${!a[1]} is named ref in bash
19pass pass ${!a} on array
20pass pass All elements unquoted
21pass pass All elements quoted
22pass pass $*
23pass pass "$*"
24pass pass Interpolate array into array
25pass pass Exporting array doesn't do anything, not even first element
26pass pass strict_array prevents exporting array
27pass pass Arrays can't be used as env bindings
28pass pass Set element
29pass pass Set element with var ref
30pass pass Set element with array ref
31pass pass Set array item to array
32pass pass Slice of array with [@]
33pass pass Negative slice begin
34pass pass Negative slice length
35pass pass Slice with arithmetic
36pass pass Number of elements
37pass pass Length of an element
38pass pass Iteration
39pass pass glob within array yields separate elements
40pass pass declare array and then append
41pass pass Array syntax in wrong place
42FAIL FAIL Single array with :-
detailsdetails
43pass pass Stripping a whole array unquoted
44pass pass Stripping a whole array quoted
45pass pass Multiple subscripts not allowed
46pass pass Length op, index op, then transform op is not allowed
47pass pass ${mystr[@]} and ${mystr[*]} are no-ops
48pass pass ${mystr[@]} and ${mystr[*]} disallowed with strict_array
49pass pass Create a "user" array out of the argv array
50pass pass Tilde expansion within array
51pass pass Brace Expansion within Array
52pass pass array default
53pass pass Singleton Array Copy and Assign. OSH can't index strings with ints
54pass pass declare -a / local -a is empty array
55pass pass Create sparse array
56pass pass Create sparse array implicitly
57pass pass Append sparse arrays
58pass pass Slice of sparse array with [@]
59pass pass Using an array itself as the index on LHS
60pass pass Using an array itself as the index on RHS
61pass pass a[$x$y] on LHS and RHS
62pass pass Dynamic parsing of LHS a[$code]=value
63pass pass Dynamic parsing of RHS ${a[$code]}
64FAIL FAIL Is element set? test -v a[i]
detailsdetails
65FAIL FAIL [[ -v a[i] ]]
detailsdetails
66FAIL FAIL [[ -v array[expr]] ]] does arith expression evaluation
detailsdetails
126 passed, 0 OK, 0 not implemented, 0 BUG, 4 failed, 0 timeouts, 0 cases skipped
4 failed under osh

Details on runs that didn't PASS

osh42 Single array with :-

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

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

[osh-cpp stdout] Expected "['none', 'x', 'none']\n", got "['x', '']\n"

stdout:
['x', '']
stderr:
osh64 Is element set? test -v a[i]

[osh stdout] Expected 'no quotes\nstatus=0\nempty=0\nstatus=1\n\narith expr\nstatus=0\nstatus=1\n' Got 'no quotes\nstatus=1\nempty=1\nstatus=1\n\narith expr\nstatus=1\nstatus=1\n'

stdout:
no quotes
status=1
empty=1
status=1

arith expr
status=1
status=1
stderr:
osh-cpp64 Is element set? test -v a[i]

[osh-cpp stdout] Expected 'no quotes\nstatus=0\nempty=0\nstatus=1\n\narith expr\nstatus=0\nstatus=1\n' Got 'no quotes\nstatus=1\nempty=1\nstatus=1\n\narith expr\nstatus=1\nstatus=1\n'

stdout:
no quotes
status=1
empty=1
status=1

arith expr
status=1
status=1
stderr:
osh65 [[ -v a[i] ]]

[osh stdout] Expected 'status=0\nstatus=1\n\nstatus=0\nstatus=1\n', got 'status=1\nstatus=1\n\nstatus=1\nstatus=1\n'

stdout:
status=1
status=1

status=1
status=1
stderr:
osh-cpp65 [[ -v a[i] ]]

[osh-cpp stdout] Expected 'status=0\nstatus=1\n\nstatus=0\nstatus=1\n', got 'status=1\nstatus=1\n\nstatus=1\nstatus=1\n'

stdout:
status=1
status=1

status=1
status=1
stderr:
osh66 [[ -v array[expr]] ]] does arith expression evaluation

[osh stdout] Expected 'zero=0\none=0\ntwo=1\n---\nzero=0\none=0\ntwo=1\n---\nzero=0\none=0\ntwo=1\n' Got 'zero=1\none=1\ntwo=1\n---\nzero=1\none=1\ntwo=1\n---\nzero=1\none=1\ntwo=1\n'

stdout:
zero=1
one=1
two=1
---
zero=1
one=1
two=1
---
zero=1
one=1
two=1
stderr:
osh-cpp66 [[ -v array[expr]] ]] does arith expression evaluation

[osh-cpp stdout] Expected 'zero=0\none=0\ntwo=1\n---\nzero=0\none=0\ntwo=1\n---\nzero=0\none=0\ntwo=1\n' Got 'zero=1\none=1\ntwo=1\n---\nzero=1\none=1\ntwo=1\n---\nzero=1\none=1\ntwo=1\n'

stdout:
zero=1
one=1
two=1
---
zero=1
one=1
two=1
---
zero=1
one=1
two=1
stderr: