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

Missing tests for IdSet #56258

Merged
merged 2 commits into from
Dec 14, 2024
Merged

Missing tests for IdSet #56258

merged 2 commits into from
Dec 14, 2024

Conversation

kshyatt
Copy link
Contributor

@kshyatt kshyatt commented Oct 20, 2024

No description provided.

@kshyatt kshyatt added the test This change adds or pertains to unit tests label Oct 20, 2024
Copy link
Member

@inkydragon inkydragon left a comment

Choose a reason for hiding this comment

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

@inkydragon inkydragon added the merge me PR is reviewed. Merge when all tests are passing label Dec 11, 2024
@@ -1037,6 +1037,8 @@ end
@test !isempty(A)
A = empty!(A)
@test isempty(A)
@test isnothing(sizehint!(A, 10))
Copy link
Member

Choose a reason for hiding this comment

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

Is there a better way to test this sizehint!() call? Maybe by looking at the length of .ht before and after the sizehint!() call?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a new TODO?

julia/base/idset.jl

Lines 81 to 93 in 10f294b

function sizehint!(s::IdSet, newsz)
# TODO: grow/compact list and perform rehash, if profitable?
# TODO: shrink?
# s.list = resize(s.list, newsz)
# newsz = _tablesz(newsz)
# oldsz = length(s.idxs)
# #grow at least 25%
# if newsz < (oldsz*5)>>2
# return s
# end
# rehash!(s, newsz)
nothing
end

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I didn't realize it was currently a no-op.

@@ -1037,6 +1037,8 @@ end
@test !isempty(A)
A = empty!(A)
@test isempty(A)
@test isnothing(sizehint!(A, 10))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@test isnothing(sizehint!(A, 10))
@test isnothing(sizehint!(A, 10)) # Currently a no-op. TODO: Add a better test once the functionality has been implemented.

@DilumAluthge DilumAluthge merged commit f84d0c4 into master Dec 14, 2024
8 checks passed
@DilumAluthge DilumAluthge deleted the ksh/idset branch December 14, 2024 21:07
@DilumAluthge DilumAluthge removed the merge me PR is reviewed. Merge when all tests are passing label Dec 14, 2024
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.

3 participants