Skip to content

Commit

Permalink
Merge pull request #14 from ChevronETC/isequal
Browse files Browse the repository at this point in the history
== method
  • Loading branch information
samtkaplan authored Feb 2, 2024
2 parents 1a37fac + 4348ac9 commit 4e7fac0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/FolderStorage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Return a representation of a POSIX folder where, for example, `d=Dict("foldernam
AbstractStorage.Container(::Type{Folder}, d::Dict, session=nothing; nretry=10) =
Folder(d["foldername"]; nretry = get(d, "nretry", nretry))

Base.:(==)(x::Folder, y::Folder) = x.foldername == y.foldername

"""
mkpath(c::Folder)
Expand Down
11 changes: 11 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,15 @@ end
write(o, "hello")
@test read(o, String) == "hello"
rm(c)
end

@testset "equality" begin
c = Folder(joinpath(base, "foo"))
d = Folder(joinpath(base, "foo"))
e = Folder(joinpath(base, "bar"))
@test c == d
@test c != e
rm(c)
rm(d)
rm(e)
end

0 comments on commit 4e7fac0

Please sign in to comment.