Skip to content

Commit 8cf8acb

Browse files
committed
Fix test
`Broadcasted` should behave like a cartesian-indexed Array. (we don't always call `foldl` for performance)
1 parent 32e7df3 commit 8cf8acb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/broadcast.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -911,9 +911,9 @@ end
911911
@test IndexStyle(bc) == IndexLinear()
912912
@test reduce(paren, bc) == reduce(paren, xs)
913913
# If `Broadcasted` does not have `IndexLinear` style, it should
914-
# hit the `foldl` branch:
914+
# behave like a cartesian-indexed Array (PR #43618)
915915
@test IndexStyle(bcraw) == IndexCartesian()
916-
@test reduce(paren, bcraw) == foldl(paren, xs)
916+
@test reduce(paren, bcraw) == reduce(paren, view(xs, 1:length(xs), 1:1))
917917

918918
# issue #41055
919919
bc = Broadcast.instantiate(Broadcast.broadcasted(Base.literal_pow, Ref(^), [1,2], Ref(Val(2))))

0 commit comments

Comments
 (0)