Skip to content

Commit cce57b6

Browse files
tkfdlfivefifty
authored andcommitted
Fix lmul! and rmul! for Julia 1.1 (#67)
The tests now check if those methods are compatible with how they work with `Matrix`.
1 parent 3fccb53 commit cce57b6

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/test_blockarrays.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,19 +316,23 @@ end
316316
@testset "lmul!/rmul!" begin
317317
A = PseudoBlockArray{Float64}(undef, 1:3)
318318
@test fill!(A, NaN) === A
319+
@test all(isnan, lmul!(0.0, copy(A))) == all(isnan, lmul!(0.0, Array(A)))
320+
@test lmul!(false, copy(A)) == lmul!(false, Array(A))
319321
@test lmul!(0.0, A) === A
320-
@test Array(A) == zeros(6)
321322
@test fill!(A, NaN) === A
323+
@test all(isnan, rmul!(copy(A), 0.0)) == all(isnan, rmul!(Array(A), 0.0))
324+
@test rmul!(copy(A), false) == rmul!(Array(A), false)
322325
@test rmul!(A, 0.0) === A
323-
@test Array(A) == zeros(6)
324326

325327
A = BlockArray{Float64}(undef, 1:3)
326328
@test fill!(A, NaN) === A
329+
@test all(isnan, lmul!(0.0, copy(A))) == all(isnan, lmul!(0.0, Array(A)))
330+
@test lmul!(false, copy(A)) == lmul!(false, Array(A))
327331
@test lmul!(0.0, A) === A
328-
@test Array(A) == zeros(6)
329332
@test fill!(A, NaN) === A
333+
@test all(isnan, rmul!(copy(A), 0.0)) == all(isnan, rmul!(Array(A), 0.0))
334+
@test rmul!(copy(A), false) == rmul!(Array(A), false)
330335
@test rmul!(A, 0.0) === A
331-
@test Array(A) == zeros(6)
332336
end
333337

334338
@testset "copy" begin

0 commit comments

Comments
 (0)