Skip to content

Simple tests for IdSet#35781

Merged
kshyatt merged 1 commit intomasterfrom
ksh/idset
Jul 9, 2021
Merged

Simple tests for IdSet#35781
kshyatt merged 1 commit intomasterfrom
ksh/idset

Conversation

@kshyatt
Copy link
Copy Markdown
Member

@kshyatt kshyatt commented May 7, 2020

Appears to be missing tests.

@kshyatt kshyatt added the test This change adds or pertains to unit tests label May 7, 2020
@kshyatt kshyatt requested a review from JeffBezanson May 7, 2020 10:31
@test !isempty(A)
A = empty!(A)
@test isempty(A)
end
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to test that elements are compared with ===, e.g. using an IdSet{Vector{Int}}.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better now?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe something like

julia> s = Base.IdSet{Vector{Int}}([a, b])
Base.IdSet{Array{Int64,1}} with 2 elements:
  [1]
  [2]

julia> a  s
true

julia> c = [1]
1-element Array{Int64,1}:
 1

julia> c  s
false

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would probably be good to also add something that is == a, but not === a to test that it's not just a regular Dict.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make such a test, I guess one could e.g. use Vector{Int} keys:

julia> dict = IdDict([0] => 1, [0] => 2)
IdDict{Array{Int64,1},Int64} with 2 entries:
  [0] => 1
  [0] => 2

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That said, this PR looks like a nice improvement, so even without that, it'd be nice to merge it (and improve it later?) Depending on whether @kshyatt still has any interest on "finishing" this or not, it'd be a shame to let this go to waste?

@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented May 14, 2020

pinging again gently for a second review :)

@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Jan 2, 2021 via email

@StefanKarpinski
Copy link
Copy Markdown
Member

Anything to be done here? Does this still need review or can we just merge it?

@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Jul 7, 2021

Updated this PR. I think we can just merge it as is if it passes tests and make further improvements later.

@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Jul 9, 2021

Got the ok from @StefanKarpinski to merge

@kshyatt kshyatt merged commit 0faa881 into master Jul 9, 2021
@kshyatt kshyatt deleted the ksh/idset branch July 9, 2021 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test This change adds or pertains to unit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants