Skip to content

Commit 7fca31e

Browse files
committed
Use different tests depending on whether check-bounds=yes
1 parent 1fcce03 commit 7fca31e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/InterpolationTestUtils.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,18 @@ function check_inbounds_values(itp, A)
5353
for i in eachindex(itp)
5454
@test A[i] itp[i] == itp[Tuple(i)...] itp(i) itp(float.(Tuple(i))...)
5555
end
56+
cb = Base.JLOptions().check_bounds == 1
5657
if ndims(itp) == 1
5758
for i in eachindex(itp)
5859
@test itp[i,1] A[i] # used in the AbstractArray display infrastructure
5960
@test_throws BoundsError itp[i,2]
60-
@test getindexib(itp, i, 2) A[i]
61-
@test callib(itp, i, 2) A[i]
61+
if cb
62+
@test_throws BoundsError getindexib(itp, i, 2)
63+
@test_throws BoundsError callib(itp, i, 2)
64+
else
65+
@test getindexib(itp, i, 2) A[i]
66+
@test callib(itp, i, 2) A[i]
67+
end
6268
end
6369
end
6470
nothing

0 commit comments

Comments
 (0)