Skip to content

Commit

Permalink
Test printing
Browse files Browse the repository at this point in the history
  • Loading branch information
mfherbst committed Nov 14, 2024
1 parent 195fc54 commit 49aafc3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/pseudofamily.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ Base.Broadcast.broadcastable(l::PseudoFamily) = Ref(l)
function Base.show(io::IO, family::PseudoFamily)
print(io, "PseudoFamily(\"$(family.identifier)\")")
end
function Base.show(io::IO, ::MIME"text/plain", family::PseudoFamily)
show(io, family)
end
Base.show(io::IO, ::MIME"text/plain", family::PseudoFamily) = show(io, family)

#
# Helper functions (not exported)
Expand Down
6 changes: 6 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,10 @@ using Test
@test joinpath(basedir, "Si.upf") in values(family)
@test family[:Si] == joinpath(basedir, "Si.upf")
end

@testset "Printing " begin
io = IOBuffer()
show(io, family)
@test occursin("PseudoFamily", String(take!(io)))
end
end

0 comments on commit 49aafc3

Please sign in to comment.