Skip to content

Commit

Permalink
Tests: use Base.splat for compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jipolanco committed Jan 31, 2023
1 parent bcf4bb9 commit 318e0b8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions test/reductions.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using MPI
using PencilArrays
using Test
using Compat: Splat

MPI.Init()

Expand Down Expand Up @@ -30,7 +29,7 @@ fill!(u, 2myid)
a = @inferred sum(abs2, û; init = zero(eltype(û))) # `init` needed for inference when eltype(û) = Complex{Int32}...
# These should all be equivalent:
b = @inferred mapreduce((x, y) -> real(x * conj(y)), +, û, v̂)
c = @inferred sum(Splat((x, y) -> real(x * conj(y))), zip(û, v̂))
c = @inferred sum(Base.splat((x, y) -> real(x * conj(y))), zip(û, v̂))
d = @inferred sum(xs -> real(xs[1] * conj(xs[2])), zip(û, v̂))
@test a == b == c == d
end
Expand Down

0 comments on commit 318e0b8

Please sign in to comment.