Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 1-arg methods for set comparisons #50862

Merged
merged 6 commits into from
Oct 28, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add tests for 1-arg forms of set comparisons
  • Loading branch information
longemen3000 committed Aug 9, 2023
commit 1144a43015bacd7b1b7a46297de878c3389bd13a
13 changes: 13 additions & 0 deletions test/sets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,9 @@ end
@test issubset(intersect(l,r), r)
@test issubset(l, union(l,r))
@test issubset(r, union(l,r))
@test issubset(union(l,r))(r)
@test isdisjoint(l,l) == isempty(l)
@test isdisjoint(l)(l) == isempty(l)
@test isdisjoint(l,r) == isempty(intersect(l,r))
if S === Vector
@test sort(union(intersect(l,r),symdiff(l,r))) == sort(union(l,r))
Expand All @@ -381,6 +383,15 @@ end
@test ⊋(S([1,2]), S([1]))
@test !⊋(S([1]), S([1]))
@test ⊉(S([1]), S([2]))

@test ⊆(S([1,2]))(S([1]))
@test ⊊(S([1,2]))(S([1]))
@test !⊊(S([1]))(S([1]))
@test ⊈(S([2]))(S([1]))
@test ⊇(S([1]))(S([1,2]))
@test ⊋(S([1]))(S([1,2]))
@test !⊋(S([1]))(S([1]))
@test ⊉(S([2]))(S([1]))
end
let s1 = S([1,2,3,4])
@test s1 !== symdiff(s1) == s1
Expand Down Expand Up @@ -837,6 +848,8 @@ end
@test !(B ⊉ A)
@test !issetequal(A, B)
@test !issetequal(B, A)
@test !issetequal(B)(A)
@test !issetequal(A)(B)
for T = (Tuple, identity, Set, BitSet, Base.IdSet{Int})
@test issetequal(A, T(A))
@test issetequal(B, T(B))
Expand Down