-
Notifications
You must be signed in to change notification settings - Fork 141
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
Making ByteString.hGetLine behave like System.IO.hGetLine #327
Draft
dbramucci
wants to merge
6
commits into
haskell:master
Choose a base branch
from
dbramucci:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Commits on Oct 28, 2020
-
Made
BS.hGetLine
's behavior likehGetLine
.This closes issue haskell#13. The changes can be summarized as updating `findEOL` to look for "\r\n" in CRLF mode and updating the logic of `haveBuf` to resize the buffer according to the size of the newline. Additionally, tests were added to verify that both `hGetLine`s produce the same behavior. Some of the edge-cases to worry about here include * '\n' still counts as a line end. Thus line endings' length vary between 1 and 2 in CRLF mode. * "\r\r\n" can give a false-start. This means you can't always skip 2 characters when `c' /= '\n'`. * '\r' when not followed by '\n' isn't part of a newline. * Not reading out of the buffer when '\r' is the last character.
Configuration menu - View commit details
-
Copy full SHA for 5b169ec - Browse repository at this point
Copy the full SHA 5b169ecView commit details
Commits on Nov 7, 2020
-
Configuration menu - View commit details
-
Copy full SHA for a70a788 - Browse repository at this point
Copy the full SHA a70a788View commit details -
Removed the redundant test for hGetLine.
The old test had wrote a special file filled with strange line endings. Now that there is a reliable, and consistent property test available for hGetLine, this code can be removed at little cost.
Configuration menu - View commit details
-
Copy full SHA for 537080c - Browse repository at this point
Copy the full SHA 537080cView commit details
Commits on Nov 22, 2020
-
Configuration menu - View commit details
-
Copy full SHA for a3d4c5f - Browse repository at this point
Copy the full SHA a3d4c5fView commit details
Commits on Nov 27, 2020
-
Cleaned up prop_hgetline_like_s8_hgetline and fixed a Windows testing…
… bug. On Windows, the test data would be written using the platform newlines. This means that any lone \n would become a \r\n. The consequence is that the property would fail to test the implementation on linux line endings when developing on windows. The fix is to set the newlineMode to noNewlineTranslation before writing the test data.
Configuration menu - View commit details
-
Copy full SHA for 6f6a098 - Browse repository at this point
Copy the full SHA 6f6a098View commit details -
Slight tweak to hgetline property's newlines.
The variables were renamed to make boolean correspondance clearer. Also, True was changed to CRLF in order to get QuickCheck to try shrinking from CRLF to LF if possible.
Configuration menu - View commit details
-
Copy full SHA for 3e34f48 - Browse repository at this point
Copy the full SHA 3e34f48View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.