Skip to content

Commit 852fe9a

Browse files
dizzzzadamretter
authored andcommitted
[test] Further tests for Array IndexOutOfBoundsException
1 parent 961d864 commit 852fe9a

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

test/src/xquery/arrays/arrays.xql

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,28 @@ function arr:function-item-invalid() {
136136

137137
declare
138138
%test:assertError("FOAY0001")
139-
function arr:get-item-out-of-bounds() {
139+
function arr:get-item-out-of-bounds-positive() {
140140
let $a := [13, 10, 14]
141141
return
142142
array:get($a, 22)
143143
};
144144

145+
declare
146+
%test:assertError("FOAY0001")
147+
function arr:get-item-out-of-bounds-zero() {
148+
let $a := [13, 10, 14]
149+
return
150+
array:get($a, 0)
151+
};
152+
153+
declare
154+
%test:assertError("FOAY0001")
155+
function arr:get-item-out-of-bounds-negative() {
156+
let $a := [13, 10, 14]
157+
return
158+
array:get($a, -1)
159+
};
160+
145161
declare
146162
%test:args(1)
147163
%test:assertEmpty

0 commit comments

Comments
 (0)