Skip to content

Commit

Permalink
Simple tests for IdSet
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt committed Jul 7, 2021
1 parent 4733c00 commit 4dea29b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/sets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -756,3 +756,24 @@ Base.IteratorSize(::Type{<:OpenInterval}) = Base.SizeUnknown()
@test 3 i
@test issubset(3, i)
end

@testset "IdSet" begin
a = [1]
b = [2]
c = [3]
d = [4]
A = Base.IdSet{Vector{Int}}([a, b, c, d])
@test !isempty(A)
B = copy(A)
@test A B
@test B A
A = filter!(x->isodd(x[1]), A)
@test A B
@test !(B A)
@test !isempty(A)
a_ = pop!(A, a)
@test a_ === a
@test !isempty(A)
A = empty!(A)
@test isempty(A)
end

0 comments on commit 4dea29b

Please sign in to comment.