Skip to content

Commit 5ceee98

Browse files
committed
Add tests
1 parent 8a7bdfe commit 5ceee98

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/cholmod.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,9 +589,13 @@ end
589589

590590
@testset "cholesky, no permutation $Tv" begin
591591
Fs = cholesky(As, perm=[1:3;])
592+
@test sort(collect(propertynames(Fs))) == sort([:L, :U, :PtL, :UP, :p, :ptr])
592593
@test Fs.p == [1:3;]
593594
@test sparse(Fs.L) Lf
594595
@test sparse(Fs) As
596+
@test_throws CHOLMOD.CHOLMODException sparse(Fs.U)
597+
@test_throws CHOLMOD.CHOLMODException sparse(Fs.PtL)
598+
@test_throws CHOLMOD.CHOLMODException sparse(Fs.UP)
595599
b = rand(Tv, 3)
596600
bs = sparse(b)
597601
@test Fs\b Af\b (Fs\bs)::SparseVector
@@ -645,9 +649,18 @@ end
645649

646650
@testset "ldlt, no permutation" begin
647651
Fs = ldlt(As, perm=[1:3;])
652+
@test sort(collect(propertynames(Fs))) == sort([:L, :U, :PtL, :UP, :D, :LD, :DU, :PtLD, :DUP, :p, :ptr])
648653
@test Fs.p == [1:3;]
649654
@test sparse(Fs.LD) LDf
650655
@test sparse(Fs) As
656+
@test_throws CHOLMOD.CHOLMODException sparse(Fs.L)
657+
@test_throws CHOLMOD.CHOLMODException sparse(Fs.U)
658+
@test_throws CHOLMOD.CHOLMODException sparse(Fs.PtL)
659+
@test_throws CHOLMOD.CHOLMODException sparse(Fs.UP)
660+
@test_throws CHOLMOD.CHOLMODException sparse(Fs.D)
661+
@test_throws CHOLMOD.CHOLMODException sparse(Fs.DU)
662+
@test_throws CHOLMOD.CHOLMODException sparse(Fs.PtLD)
663+
@test_throws CHOLMOD.CHOLMODException sparse(Fs.DUP)
651664
b = rand(Tv, 3)
652665
bs = sparse(b)
653666
@test Fs\b Af\b (Fs\bs)::SparseVector

0 commit comments

Comments
 (0)