-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix issue #465. Added tests and adjusted logic to get more complete test coverage #530
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
Fix issue #465. Added tests and adjusted logic to get more complete test coverage #530
Conversation
Added tests in HashTableTests for collision handling and resizing behavior. Improved null handling in HashTable methods and adjusted resizing logic.
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.
Pull Request Overview
This PR fixes issue #465 by enhancing test coverage and improving code clarity in the HashTable and TimSorter implementations. The changes focus on adding comprehensive tests for collision handling, resizing behavior, and edge cases while modernizing the codebase with C# language features.
- Added extensive test coverage for HashTable collision handling, resizing logic, and edge cases
- Modernized TimSorter and related classes with primary constructors and improved null handling
- Simplified HashTable implementation by removing version tracking and consolidating null checks
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
DataStructures/Hashing/HashTable.cs | Simplified null checks using default keyword, removed version tracking, and improved resizing logic |
DataStructures.Tests/Hashing/HashTableTests.cs | Added comprehensive tests for collision handling, resizing behavior, and edge cases |
Algorithms/Sorters/Comparison/TimSorterSettings.cs | Modernized with primary constructor pattern |
Algorithms/Sorters/Comparison/TimSorter.cs | Added null validation and improved documentation |
Algorithms.Tests/Sorters/Comparison/TimSorterTests.cs | Enhanced test coverage with clearer naming and additional edge case tests |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #530 +/- ##
==========================================
- Coverage 95.15% 95.14% -0.01%
==========================================
Files 272 272
Lines 10875 10862 -13
Branches 1529 1530 +1
==========================================
- Hits 10348 10335 -13
Misses 400 400
Partials 127 127 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Remove un-needed default comparer
Add test for minimum HashTable size
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.
Looks good, thanks! I'll keep the issue open for a while to see if the issue appears again or it is resolved completely
Added more TimSorterTests tests and changed method names for clarity.
Added tests in HashTableTests for collision handling and resizing behavior.
Improved null handling in HashTable methods and adjusted resizing logic.