-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
KeyAnalyzer tests. #90301
KeyAnalyzer tests. #90301
Conversation
Tagging subscribers to this area: @dotnet/area-system-collections Issue DetailsHoisted the calculation of the maximum collisions allow outside the Hoisted the calculation of the maximum offset outside of the offset Made ContainsAnyLetters and SufficientUniquenessFactor Added tests for ContainsAnyLetters and SufficientUniquenessFactor are working correctly.
|
Can we please undo the hoisting-related changes then? Let's keep this just tests. |
Removed the one that isn't needed for testing. |
Made ContainsAnyLetters and SufficientUniquenessFactor internal so they can be tested. Hoisted the calculation of the maximum collisions allowed outside the HasSufficientUniquenessFactor for testability (the calculation only needs to be done once). Added tests for ContainsAnyLetters and SufficientUniquenessFactor are working correctly.
ba0c068
to
4f7dbe4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution!
The test is failing, but I think I've found the reason. I am going to apply my suggestion and merge it if the CI gets green.
src/libraries/System.Collections.Immutable/tests/Frozen/KeyAnalyzerTests.cs
Outdated
Show resolved
Hide resolved
Yep, that was from when it was still using my other Since we're not using that code right now, the test was wrong, sorry. Thanks for fixing it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you @IDisposable !
This is based extracting the unit tests for KeyAnalyzer and a couple trivial code simplifications without the huge changes in PR #89863
Hoisted the calculation of the maximum collisions allow outside the
HasSufficientUniquenessFactor
as the calculation only needs to be done once (also makes it more testable).Made
ContainsAnyLetters
andSufficientUniquenessFactor
internal
so they can be tested.Added tests for
ContainsAnyLetters
andSufficientUniquenessFactor
are working correctly.