Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken test on older Julia versions on Linux. #48

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion test/MATFrostTest/src/MATFrostTest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,21 @@ struct Nest2
vs::Vector{Nest1}
end

sum_nest2(v::Nest2) :: Float64 = sum(sum_nest1(e) for e in v.v1) + sum(sum_nest1(e) for e in v.vs; init=0.0)
# The following function breaks on older Linux Julia versions. Curious behavior.
sum_nest2_breaking(v::Nest2) :: Float64 = sum(sum_nest1(e) for e in v.v1) + sum(sum_nest1(e) for e in v.vs; init=0.0)

function sum_nest2(v::Nest2) :: Float64
acc = 0.0
for e in v.v1
acc += sum_nest1(e)
end

for e in v.vs
acc += sum_nest1(e)
end

acc
end

nest2_identity(v::Nest2) = v

Expand Down
Loading