Skip to content

Commit 378a985

Browse files
authored
Extend tests
1 parent 8540bde commit 378a985

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

Diff for: test/runtests.jl

+17-6
Original file line numberDiff line numberDiff line change
@@ -482,14 +482,25 @@ end
482482
@test ldiv!(tempmat, lu(cmat + I), cmat) isa ComponentMatrix
483483
@test ldiv!(getdata(tempmat), lu(cmat + I), cmat) isa AbstractMatrix
484484

485-
vca2 = vcat(ca2', ca2')
486-
hca2 = hcat(ca2, ca2)
485+
for n in 1:3 # Issue 168 cats (on more than one) ComponentArrays
486+
vca2 = vcat(repeat([ca2'], n)...)
487+
hca2 = hcat(repeat([ca2], n)...)
488+
hca2_reduced = reduce(hcat, repeat([ca2], n)) # Issue 113: reduce cats should match non-reduced ones
489+
vca2_reduced = reduce(vcat, repeat([ca2'], n))
490+
@test hca2 == hca2_reduced
491+
@test typeof(hca2) == typeof(hca2_reduced)
492+
@test vca2 == vca2_reduced
493+
@test typeof(vca2) == typeof(vca2_reduced)
494+
@test hca2 isa ComponentMatrix
495+
@test vca2 isa ComponentMatrix
496+
@test all(vca2[1, :] .== ca2)
497+
@test all(hca2[:, 1] .== ca2)
498+
@test all(vca2' .== hca2)
499+
@test hca2[:a, :] == vca2[:, :a]
500+
end
501+
487502
temp = ComponentVector(q = 100, r = rand(3, 3, 3))
488503
vtempca = [temp; ca]
489-
@test all(vca2[1, :] .== ca2)
490-
@test all(hca2[:, 1] .== ca2)
491-
@test all(vca2' .== hca2)
492-
@test hca2[:a, :] == vca2[:, :a]
493504
@test vtempca isa ComponentVector
494505
@test vtempca.r == temp.r
495506
@test vtempca.c == ca.c

0 commit comments

Comments
 (0)