Skip to content

Commit

Permalink
Improve show(io::IO, ::NullSetter)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Sep 28, 2019
1 parent b09d2be commit aaa25f2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/setters.jl
Expand Up @@ -21,6 +21,9 @@ julia> set(1, nullsetter, 2)
"""
const nullsetter = NullSetter()

Base.show(io::IO, ::NullSetter) = print(io, "nullsetter")
# TODO: handle prefix

"""
ToField(f) :: Setter
Expand Down
1 change: 1 addition & 0 deletions test/test_prettylens.jl
Expand Up @@ -15,6 +15,7 @@ include("preamble.jl")
));
context = :compact => true,
) == "◻.a∘〈last(◻),◻[:c].d∘(←exp|log→)〉"
@test prettylens(nullsetter) == "nullsetter"
end

end # module
1 change: 1 addition & 0 deletions test/test_setters.jl
Expand Up @@ -4,6 +4,7 @@ include("preamble.jl")

@testset "nullsetter" begin
@test set(1, nullsetter, 2) === 1
@test string(nullsetter) === "nullsetter"
end

@testset "ToField" begin
Expand Down

0 comments on commit aaa25f2

Please sign in to comment.