Skip to content

Commit 193f15b

Browse files
committed
Tests for scaling mul!
1 parent 613935b commit 193f15b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/generic.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,4 +857,17 @@ end
857857
end
858858
end
859859

860+
@testset "scaling mul" begin
861+
v = 1:4
862+
w = similar(v)
863+
@test mul!(w, 2, v) == 2v
864+
@test mul!(w, v, 2) == 2v
865+
@test mul!(copy!(similar(v), v), 2, v, 1, 3) == 5v
866+
@test mul!(copy!(similar(v), v), v, 2, 1, 3) == 5v
867+
@test mul!(copy!(similar(v), v), 2, v, 2, 3) == 7v
868+
@test mul!(copy!(similar(v), v), v, 2, 2, 3) == 7v
869+
@test mul!(copy!(similar(v), v), 2, v, 2, 0) == 4v
870+
@test mul!(copy!(similar(v), v), v, 2, 2, 0) == 4v
871+
end
872+
860873
end # module TestGeneric

0 commit comments

Comments
 (0)