Skip to content

Commit

Permalink
Update test/interface_tests.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas authored Dec 21, 2023
1 parent 4d8130e commit 8854baa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/interface_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,16 @@ z .= x .+ y

@test z == VectorOfArray([fill(4, SVector{2, Float64}), fill(2, SVector{2, Float64})])

u1 = VectorOfArray([fill(2, SVector{2, Float64}), ones(SVector{2, Float64})])
u2 = VectorOfArray([fill(4, SVector{2, Float64}), 2 .* ones(SVector{2, Float64})])
u3 = VectorOfArray([fill(4, SVector{2, Float64}), 2 .* ones(SVector{2, Float64})])

function f(u1,u2,u3)
u3 .= u1 .+ u2
end
f(u1,u2,u3)
@test@allocated f(u1,u2,u3) == 0

yy = [2.0 1.0; 2.0 1.0]
zz = x .+ yy
@test zz == [4.0 2.0; 4.0 2.0]
Expand Down

0 comments on commit 8854baa

Please sign in to comment.