-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Add test verifying empty data appends have no effect on hash results #123647
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
Conversation
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
|
Tagging subscribers to this area: @dotnet/area-system-io |
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 adds a new test to verify that appending empty data (empty spans) has no observable effect on hash computation results across all non-cryptographic hash algorithm implementations.
Changes:
- Added
AppendingEmptyHasNoEffect()test method toNonCryptoHashTestDriverbase class - Test validates that interleaving empty span appends with actual data produces identical hashes to appending data alone
- Automatically applies to all implementations: CRC32, CRC64, XxHash32, XxHash64 (including seeded variants)
|
/ba-g "Failed to generate "CoreCLR component" build project!" unrelated to this test change |
Description
Adds
AppendingEmptyHasNoEffect()test toNonCryptoHashTestDriverbase class, verifying that interleaving empty span appends with actual data produces identical hashes to appending data alone.Changes
[Fact]test method toNonCryptoHashTestDriver.cs[1,2,3]vs. hash withEmpty + [1,2,3] + EmptyTesting
All 1061 tests pass, including 8 instances of the new test across hash implementations.
Original prompt
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.