From 0ef3d819c26a85cf3ac27518e52c28bfa53acae5 Mon Sep 17 00:00:00 2001 From: "Steven G. Johnson" Date: Mon, 12 Dec 2016 20:59:00 -0500 Subject: [PATCH] test for .op loop fusion --- test/broadcast.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/broadcast.jl b/test/broadcast.jl index 2f009bcbe2519..1c3c7312cb688 100644 --- a/test/broadcast.jl +++ b/test/broadcast.jl @@ -295,6 +295,10 @@ import Base.Meta: isexpr # PR #17623: Fused binary operators @test [true] .* [true] == [true] @test [1,2,3] .|> (x->x+1) == [2,3,4] +let g = Int[], ⊕ = (a,b) -> let c=a+2b; push!(g, c); c; end + @test [1,2,3] .⊕ [10,11,12] .⊕ [100,200,300] == [221,424,627] + @test g == [21,221,24,424,27,627] # test for loop fusion +end # PR 16988 @test Base.promote_op(+, Bool) === Int