Skip to content

Commit 945004f

Browse files
committed
Add tests
1 parent 40ccaf8 commit 945004f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/utils_test.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,21 @@ x = similar(x)
9999
recursivefill!(x, true)
100100
@test x[1] == MVector{10}(ones(10))
101101
@test x[2] == MVector{10}(ones(10))
102+
103+
# Test VectorOfArray + recursivefill! + static arrays
104+
@testset "VectorOfArray + recursivefill! + static arrays" begin
105+
Vec3 = SVector{3, Float64}
106+
x = [randn(Vec3, n) for n 1:4] # vector of vectors of static arrays
107+
108+
x_voa = VectorOfArray(x)
109+
@test eltype(x_voa) === Vec3
110+
@test first(x_voa) isa AbstractVector{Vec3}
111+
112+
y_voa = recursivecopy(x_voa)
113+
recursivefill!(y_voa, true)
114+
@test all(y_voa[n] == fill(ones(Vec3), n) for n 1:4)
115+
116+
y_voa = recursivecopy(x_voa)
117+
recursivefill!(y_voa, ones(Vec3))
118+
@test all(y_voa[n] == fill(ones(Vec3), n) for n 1:4)
119+
end

0 commit comments

Comments
 (0)