Skip to content

Fix content reader for partial input #50

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

Merged
merged 1 commit into from
Dec 1, 2020

Conversation

Puneetha-Ramachandra
Copy link
Contributor

When there is partial message in reader, popping out the
characters lead to parse errors on the subsequent attempt
to parse. To avoid this, the last matched characters'
index is stored during parsing and reset on error.

@ben-clayton
Copy link
Contributor

Looks good, thank you. Please can we have a test to exercise this?

When there is partial message in reader, popping out the
characters lead to parse errors on the subsequent attempt
to parse. To avoid this, the last matched characters'
index is stored during parsing and reset on error.
@Puneetha-Ramachandra
Copy link
Contributor Author

Added test. PTAL.

@ben-clayton
Copy link
Contributor

Great, thank you again!

@ben-clayton ben-clayton merged commit 77209ca into google:main Dec 1, 2020
mcnulty added a commit to mcnulty/cppdap that referenced this pull request Jul 5, 2023
Per google#115, `ContentReader::match` must block until the whole pattern is
read or the underlying `Reader` is closed. The previous commit reverted
the change from google#50 to ensure this behavior is still implemented.

This commit re-adds the unit test from google#50 with an update to the
behavior of `StringBuffer` to correct implement `Reader` so that
the partial read test case is still covered by the unit tests.
ben-clayton pushed a commit that referenced this pull request Jul 5, 2023
Per #115, `ContentReader::match` must block until the whole pattern is
read or the underlying `Reader` is closed. The previous commit reverted
the change from #50 to ensure this behavior is still implemented.

This commit re-adds the unit test from #50 with an update to the
behavior of `StringBuffer` to correct implement `Reader` so that
the partial read test case is still covered by the unit tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants