diff --git a/stdlib/LinearAlgebra/test/dense.jl b/stdlib/LinearAlgebra/test/dense.jl index 116a6da1afc12..41b38f7c62cdc 100644 --- a/stdlib/LinearAlgebra/test/dense.jl +++ b/stdlib/LinearAlgebra/test/dense.jl @@ -84,6 +84,15 @@ bimg = randn(n,2)/2 end end # for eltyb +@testset "Test diagm for vectors" begin + @test diagm(zeros(50)) == diagm(0 => zeros(50)) + @test diagm(ones(50)) == diagm(0 => ones(50)) + for i = 1:50 + v = randn(500) + @test diagm(v) == diagm(0 => v) + end +end + @testset "Test pinv (rtol, atol)" begin M = [1 0 0; 0 1 0; 0 0 0] @test pinv(M,atol=1)== zeros(3,3)