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

Add unit tests for StreamExtensions, #1105 #1109

Merged
merged 5 commits into from
Jan 21, 2025

Conversation

paulirwin
Copy link
Contributor

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a change, please open an issue to discuss the change or find an existing issue.

Add unit tests for StreamExtensions

Fixes #1105

Description

Adds some tests adapted from Apache Harmony for the StreamExtensions extension methods.

@paulirwin paulirwin added the notes:improvement An enhancement to an existing feature label Jan 21, 2025
Copy link
Contributor

@NightOwl888 NightOwl888 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR.

I noticed during the review that the below comment is out of date. At one point we used BinaryReader and BinaryWriter, but it was found that they throw exceptions when you are not careful to ensure that surrogate pairs are not split up, which is what prompted the creation of these extension methods.

// LUCENENET NOTE: The serialization features here are strictly for testing purposes,
// therefore it doesn't make any difference what type of serialization is used.
// To make things simpler, we are using BinaryReader and BinaryWriter since
// BinaryFormatter is not implemented in .NET Standard 1.x.

@paulirwin paulirwin requested a review from NightOwl888 January 21, 2025 15:19
@paulirwin paulirwin merged commit 6af9708 into apache:master Jan 21, 2025
84 checks passed
@paulirwin paulirwin deleted the issue/1105 branch January 21, 2025 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notes:improvement An enhancement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Support unit tests for StreamExtensions
2 participants