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

test: Comparability and hashability of PackageInfo and MatchSpec #3369

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

jjerphan
Copy link
Member

@jjerphan jjerphan commented Jul 29, 2024

Follow-up of #3363.

This adds just some simply test for PackageInfo and MatchSpec for now.

@Hind-M Hind-M added the release::enhancements For enhancements PRs or implementing features label Jul 30, 2024
@jjerphan jjerphan force-pushed the test/hashability-comparability branch from 2ab8714 to 89360de Compare July 30, 2024 13:19
@jjerphan jjerphan marked this pull request as ready for review July 30, 2024 13:20
libmamba/include/mamba/specs/regex_spec.hpp Show resolved Hide resolved
@@ -565,7 +565,7 @@ struct std::hash<mamba::util::flat_set<Key, Compare, Allocator>>
{
auto operator()(const mamba::util::flat_set<Key, Compare, Allocator>& set) const -> std::size_t
{
return mamba::util::hash_vals(set);
return mamba::util::hash_range(set);
Copy link
Member

Choose a reason for hiding this comment

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

Why this change?

Copy link
Member Author

@jjerphan jjerphan Jul 30, 2024

Choose a reason for hiding this comment

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

hash_vals hashes set as a value rather than its' internal elements (I thought it would).

hash_range considers set a range and hashes all of its elements.

Copy link
Member

Choose a reason for hiding this comment

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

I'm actually wondering about the use cases of using hash_vals, and btw I just realized there are no tests for hash_vals. Would you mind adding them please? (in this PR or another one, as you prefer).

Copy link
Member Author

Choose a reason for hiding this comment

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

hash_vals is used to combine the hashes of individual scalar values. I can open a PR after this one to test its behavior.

libmamba/include/mamba/util/heap_optional.hpp Show resolved Hide resolved
Copy link
Member

@Hind-M Hind-M left a comment

Choose a reason for hiding this comment

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

Can you please rebase now that #3371 is merged? Thanks.

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
@jjerphan jjerphan force-pushed the test/hashability-comparability branch from 89360de to 2758eca Compare July 30, 2024 14:33
@Hind-M Hind-M merged commit ca8cee5 into mamba-org:main Jul 30, 2024
32 checks passed
@jjerphan jjerphan deleted the test/hashability-comparability branch July 30, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release::enhancements For enhancements PRs or implementing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants