diff --git a/base/linalg/cholesky.jl b/base/linalg/cholesky.jl index 5efb8bd0741e7..aa7e82a5c4d37 100644 --- a/base/linalg/cholesky.jl +++ b/base/linalg/cholesky.jl @@ -406,7 +406,7 @@ function show(io::IO, C::Cholesky{<:Any,<:AbstractMatrix}) println(io, "$(typeof(C)) with factor:") show(io, C[:UL]) else - print("Failed factorization of type $(typeof(C))") + print(io, "Failed factorization of type $(typeof(C))") end end diff --git a/test/linalg/cholesky.jl b/test/linalg/cholesky.jl index eb8d811b1aba2..41b7093f3426a 100644 --- a/test/linalg/cholesky.jl +++ b/test/linalg/cholesky.jl @@ -13,7 +13,7 @@ function unary_ops_tests(a, ca, tol; n=size(a, 1)) @test isposdef(ca) @test_throws KeyError ca[:Z] @test size(ca) == size(a) - @test Matrix(copy(ca)) ≈ a + @test Array(copy(ca)) ≈ a end function factor_recreation_tests(a_U, a_L) @@ -21,7 +21,7 @@ function factor_recreation_tests(a_U, a_L) c_L = cholfact(a_L) cl = chol(a_L) ls = c_L[:L] - @test Matrix(c_U) ≈ Matrix(c_L) ≈ a_U + @test Array(c_U) ≈ Array(c_L) ≈ a_U @test ls*ls' ≈ a_U @test triu(c_U.factors) ≈ c_U[:U] @test tril(c_L.factors) ≈ c_L[:L] @@ -180,6 +180,8 @@ end C = cholfact(A) @test !isposdef(C) @test !LinAlg.issuccess(C) + Cstr = sprint(show, C) + @test Cstr == "Failed factorization of type $(typeof(C))" @test_throws PosDefException C\B @test_throws PosDefException det(C) @test_throws PosDefException logdet(C) diff --git a/test/linalg/tridiag.jl b/test/linalg/tridiag.jl index 85276d686512c..3c1384565284c 100644 --- a/test/linalg/tridiag.jl +++ b/test/linalg/tridiag.jl @@ -288,7 +288,7 @@ guardsrand(123) do invFsv = Fs\vv x = Ts\vv @test x ≈ invFsv - @test Array(AbstractArray(Tldlt)) ≈ Fs + @test Array(Tldlt) ≈ Fs end @testset "similar" begin