Skip to content

Commit b60da70

Browse files
Flesh out boundserror check
1 parent cc1978a commit b60da70

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/runtests.jl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,21 @@ CUDA.allowscalar(false)
2323
@test_throws BoundsError @view b[:, 9]
2424
end
2525

26-
@testset "Bounds error for zero-length buffer" begin
26+
@testset "Bounds error for zero-length / underfilled buffer" begin
2727
b = CircularVectorBuffer{Bool}(10)
28+
@test_throws BoundsError b[1]
2829
@test_throws BoundsError b[end]
29-
for i in 1:5
30+
31+
push!(b, true)
32+
@test b[1] == true
33+
@test b[end] == true
34+
@test_throws BoundsError b[2]
35+
for i in 1:15
3036
push!(b, true)
3137
end
3238
@test b[end] == true
39+
@test b[10] == true
40+
@test_throws BoundsError b[15]
3341
end
3442

3543
@testset "1D vector" begin

0 commit comments

Comments
 (0)