Skip to content

Commit 5ffecaf

Browse files
committed
add allocation test.
1 parent 960e1c7 commit 5ffecaf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/runtests.jl

+6
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,12 @@ Base.BroadcastStyle(::Broadcast.ArrayStyle{MyArray2}, S::Broadcast.DefaultArrayS
12291229
@test length(tested_style) == 4
12301230
end
12311231

1232+
@testset "allocation test" begin
1233+
a = StructArray{ComplexF64}(undef, 1)
1234+
allocated(a) = @allocated a .+ 1
1235+
@test allocated(a) == 2allocated(a.re)
1236+
end
1237+
12321238
@testset "StructStaticArray" begin
12331239
bclog(s) = log.(s)
12341240
test_allocated(f, s) = @test (@allocated f(s)) == 0

0 commit comments

Comments
 (0)