Skip to content

Commit 8c71cca

Browse files
authored
use nameof in show (#252)
1 parent fe5e80a commit 8c71cca

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/show.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ end
3030

3131
## Operator
3232

33-
summarystr(B::Operator) = string(typeof(B).name.name, " : ", domainspace(B), "", rangespace(B))
33+
summarystr(B::Operator) = string(nameof(typeof(B)), " : ", domainspace(B), "", rangespace(B))
3434
summary(io::IO, B::Operator) = print(io, summarystr(B))
3535

3636
struct PrintShow

test/show.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,10 @@
5151
s = String(take!(io))
5252
@test startswith(s, "ConstantSpace(0..1) /")
5353
end
54+
@testset "ConstantOperator" begin
55+
A = I : PointSpace(1:4)
56+
s = summary(A)
57+
@test startswith(s, "ConstantOperator")
58+
end
5459
end
5560
end

0 commit comments

Comments
 (0)