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

fix: return consistent results from readers #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tjallingt
Copy link

fixes #57

The test case is the same as from the issue.
That doesn't cover "consistency" fully but at least its a regression for this case.
More tests should be added to ensure that the same input produces a similar result (Ok/Err) across the different readers. I could write a macro for this if desired.

The fix is also a bit dubious. I'm not entirely sure what the output.len() < self.buffer.capacity() line is for. I removed it because I noticed that the issue was caused by the capacity set on the circular buffer. Expecting a vec with length of >= 8192 would fail but anything shorter would succeed.

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.

read_from_stream_buffered produces different results than other readers
1 participant