Skip to content

Commit fd21afa

Browse files
authored
Merge pull request #178 from kshyatt/ksh/misctest
Various misc tests
2 parents 30d126e + 089d06e commit fd21afa

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

test/chol.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
@test_throws ArgumentError chol(SMatrix{2,2}(m_a))
1212
m_a = m_a*m_a'
1313
m = SMatrix{2,2}(m_a)
14-
@test chol(m) chol(m_a)
14+
@test chol(Hermitian(m)) chol(m_a)
1515
end
1616

1717
@testset "3×3" for i = 1:100
@@ -21,5 +21,15 @@
2121
m_a = m_a*m_a'
2222
m = SMatrix{3,3}(m_a)
2323
@test chol(m) chol(m_a)
24+
@test chol(Hermitian(m)) chol(m_a)
25+
end
26+
@testset "4×4" for i = 1:100
27+
m_a = randn(4,4)
28+
#non hermitian
29+
@test_throws ArgumentError chol(SMatrix{4,4}(m_a))
30+
m_a = m_a*m_a'
31+
m = SMatrix{4,4}(m_a)
32+
@test chol(m) chol(m_a)
33+
@test chol(Hermitian(m)) chol(m_a)
2434
end
2535
end

test/deque.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@
1111
@test @inferred(deleteat(v, 2)) === @SVector [1, 3]
1212

1313
@test @inferred(setindex(v, -2, 2)) === @SVector [1, -2, 3]
14+
15+
@test_throws BoundsError insert(v, -2, 2)
16+
@test_throws BoundsError deleteat(v, -2)
17+
@test_throws BoundsError setindex(v, 2, -2)
1418
end

test/det.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
@test det(@SMatrix [0 1 0; 1 0 0; 0 0 1]) === -1
55
m = randn(Float64, 4,4)
66
@test det(SMatrix{4,4}(m)) det(m)
7-
7+
#triu/tril
88
@test det(@SMatrix [1 2; 0 3]) === 3
9+
@test det(@SMatrix [1 2 3 4; 0 5 6 7; 0 0 8 9; 0 0 0 10]) === 400.0
910

1011
# Unsigned specializations
1112
@test det(@SMatrix [0x00 0x01; 0x01 0x00])::Int8 == -1

0 commit comments

Comments
 (0)