Skip to content

Commit

Permalink
Merge pull request #48 from ASML-Labs/breaking-test-fix
Browse files Browse the repository at this point in the history
Fix broken test on older Julia versions on Linux.
  • Loading branch information
jorisbelierasml authored Aug 14, 2024
2 parents 0eb1d9f + ab6e8e7 commit f45f528
Showing 1 changed file with 15 additions and 1 deletion.
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

0 comments on commit f45f528

Please sign in to comment.