Skip to content

Commit 3b67e47

Browse files
test/broadcast: put r1, r2, ratio, m into let (#36817)
1 parent 7adb9ce commit 3b67e47

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

test/broadcast.jl

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,16 @@ for arr in (identity, as_sub)
152152
end
153153
end
154154

155-
r1 = 1:1
156-
r2 = 1:5
157-
ratio = [1,1/2,1/3,1/4,1/5]
158-
@test r1.*r2 == [1:5;]
159-
@test r1./r2 == ratio
160-
m = [1:2;]'
161-
@test m.*r2 == [1:5 2:2:10]
162-
@test m./r2 [ratio 2ratio]
163-
@test m./[r2;] [ratio 2ratio]
155+
let r1 = 1:1,
156+
r2 = 1:5,
157+
ratio = [1,1/2,1/3,1/4,1/5],
158+
m = [1:2;]'
159+
@test r1.*r2 == [1:5;]
160+
@test r1./r2 == ratio
161+
@test m.*r2 == [1:5 2:2:10]
162+
@test m./r2 [ratio 2ratio]
163+
@test m./[r2;] [ratio 2ratio]
164+
end
164165

165166
@test @inferred(broadcast(+,[0,1.2],reshape([0,-2],1,1,2))) == reshape([0 -2; 1.2 -0.8],2,1,2)
166167
rt = Base.return_types(broadcast, Tuple{typeof(+), Array{Float64, 3}, Array{Int, 1}})

0 commit comments

Comments
 (0)