Results for array.test.sh

statusoshosh-cpp
pass 7676
FAIL 22
total7878
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 Associative arrays can't be used as env bindings either
29pass pass Set element
30pass pass Set element with var ref
31pass pass Set element with array ref
32pass pass Set array item to array
33pass pass Slice of array with [@]
34pass pass Negative slice begin
35pass pass Negative slice length
36pass pass Slice with arithmetic
37pass pass Number of elements
38pass pass Length of an element
39pass pass Iteration
40pass pass glob within array yields separate elements
41pass pass declare array and then append
42pass pass Array syntax in wrong place
43pass pass Single array with :-
44pass pass Stripping a whole array unquoted
45pass pass Stripping a whole array quoted
46pass pass Multiple subscripts not allowed
47pass pass Length op, index op, then transform op is not allowed
48pass pass ${mystr[@]} and ${mystr[*]} are no-ops
49pass pass ${mystr[@]} and ${mystr[*]} disallowed with strict_array
50pass pass Create a "user" array out of the argv array
51pass pass Tilde expansion within array
52pass pass Brace Expansion within Array
53pass pass array default
54pass pass Singleton Array Copy and Assign. OSH can't index strings with ints
55pass pass declare -a / local -a is empty array
56pass pass Create sparse array
57pass pass Create sparse array implicitly
58pass pass Append sparse arrays
59pass pass Slice of sparse array with [@]
60pass pass Using an array itself as the index on LHS
61pass pass Using an array itself as the index on RHS
62pass pass a[$x$y] on LHS and RHS
63pass pass Dynamic parsing of LHS a[$code]=value
64pass pass Dynamic parsing of RHS ${a[$code]}
65pass pass Is element set? test -v a[i]
66pass pass [[ -v a[i] ]]
67FAIL FAIL test -v a[i] with arith expressions
detailsdetails
68FAIL FAIL More arith expressions in [[ -v array[expr]] ]]
detailsdetails
69pass pass Regression: Assigning with out-of-range negative index
70pass pass Regression: Negative index in [[ -v a[index] ]]
71pass pass Regression: Negative out-of-range index in [[ -v a[index] ]]
72pass pass a+=() modifies existing instance of BashArray
73pass pass Regression: unset a[-2]: out-of-bound negative index should cause error
74pass pass Regression: Out-of-bound negative offset for ${a[@]:offset}
75pass pass Regression: Array length after unset
76pass pass Regression: ${a[@]@Q} crash with `a[0]=x a[2]=y`
77pass pass Regression: silent out-of-bound negative index in ${a[-2]} and $((a[-2]))
152 passed, 0 OK, 0 not implemented, 0 BUG, 2 failed, 0 timeouts, 0 cases skipped
2 failed under osh

Details on runs that didn't PASS

osh67 test -v a[i] with arith expressions

[osh stdout] Expected 'status=0\nstatus=1\n\ndbracket\nstatus=0\nstatus=1\n' Got 'status=1\nstatus=1\n\ndbracket\nstatus=1\nstatus=1\n'

stdout:
status=1
status=1

dbracket
status=1
status=1
stderr:
osh-cpp67 test -v a[i] with arith expressions

[osh-cpp stdout] Expected 'status=0\nstatus=1\n\ndbracket\nstatus=0\nstatus=1\n' Got 'status=1\nstatus=1\n\ndbracket\nstatus=1\nstatus=1\n'

stdout:
status=1
status=1

dbracket
status=1
status=1
stderr:
osh68 More arith expressions in [[ -v array[expr]] ]]

[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-cpp68 More arith expressions in [[ -v array[expr]] ]]

[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: