Skip to content

Commit

Permalink
Add tests for products with more than two factors
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion committed Jul 28, 2017
1 parent ae26b60 commit 79b93ea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/muladd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ using DiffEqBase, Base.Test
:(function f(x, y, z) $(Base.muladd)(x, y, z) end)
@test macroexpand(:(@muladd for i in 1:n z = x*i + y end)) ==
:(for i in 1:n z = $(Base.muladd)(x, i, y) end)

# Additional factors
@test macroexpand(:(@muladd a*b*c+d)) == :($(Base.muladd)(a, b*c, d))
@test macroexpand(:(@muladd a*b*c*d+e)) == :($(Base.muladd)(a, b*c*d, e))

0 comments on commit 79b93ea

Please sign in to comment.