Skip to content

Commit 177152b

Browse files
committed
show and coverage improvements
1 parent fafa4cc commit 177152b

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/show.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ end
77
# show
88
Base.show(io::IO, A::LinearMap) = print(io, map_show(io, A, 0))
99

10-
map_show(io::IO, A::LinearMap, i) = " "^i * map_summary(A) * _show(io, A, i)
11-
map_show(io::IO, A::AbstractMatrix, i) = " "^i * string(typeof(A))
10+
map_show(io::IO, A::LinearMap, i) = ' '^i * map_summary(A) * _show(io, A, i)
11+
map_show(io::IO, A::AbstractMatrix, i) = ' '^i * summary(A)
1212
_show(io::IO, ::LinearMap, _) = ""
1313
function _show(io::IO, A::FunctionMap{T,F,Nothing}, _) where {T,F}
1414
"($(A.f); ismutating=$(A._ismutating), issymmetric=$(A._issymmetric), ishermitian=$(A._ishermitian), isposdef=$(A._isposdef))"
@@ -27,7 +27,7 @@ function _show(io::IO, A::BlockMap, i)
2727
nrows = length(A.rows)
2828
n = length(A.maps)
2929
" with $n block map" * (n>1 ? "s" : "") * " in $nrows block row" * (nrows>1 ? "s" : "") *
30-
"\n" * print_maps(io, A.maps, i+2)
30+
'\n' * print_maps(io, A.maps, i+2)
3131
end
3232
function _show(io::IO, A::BlockDiagonalMap, i)
3333
n = length(A.maps)
@@ -53,21 +53,21 @@ function print_maps(io::IO, maps::Tuple{Vararg{LinearMap}}, k)
5353
e = n-5:n
5454
if e[1] - s[end] > 1
5555
for i in s
56-
str *= map_show(io, maps[i], k) * "\n"
56+
str *= map_show(io, maps[i], k) * '\n'
5757
end
58-
str *= " "^k * ""
58+
str *= ' '^k * ''
5959
for i in e
60-
str *= "\n" * map_show(io, maps[i], k)
60+
str *= '\n' * map_show(io, maps[i], k)
6161
end
6262
else
6363
for i in 1:n-1
64-
str *= map_show(io, maps[i], k) * "\n"
64+
str *= map_show(io, maps[i], k) * '\n'
6565
end
6666
str *= map_show(io, last(maps), k)
6767
end
6868
else
6969
for i in 1:n-1
70-
str *= map_show(io, maps[i], k) * "\n"
70+
str *= map_show(io, maps[i], k) * '\n'
7171
end
7272
str *= map_show(io, last(maps), k)
7373
end

test/linearmaps.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ using Test, LinearMaps, LinearAlgebra, SparseArrays, BenchmarkTools
1919
@test ndims(M) == 2
2020
@test_throws ErrorException size(M, 3)
2121
@test length(M) == length(A)
22+
@test occursin(Base.dims2string(size(M)) * " LinearMaps.WrappedMap", summary(M))
2223
end
2324

2425
@testset "dimension checking" begin

0 commit comments

Comments
 (0)