Property tests and Char8 un/pack fix#6
Merged
MichaelXavier merged 2 commits intoSoostone:masterfrom Mar 4, 2022
Merged
Conversation
Note: These tests are failing because the pack and unpack functions in Data.ByteString.Char8 are for ASCII *only*. QuickCheck is easily finding Unicode strings that don't convert correctly using this method. This will be addressed in another commit. Also added dist-* to .gitignore for more modern cabal build artifacts.
If anything but ASCII or ISO-8859-1 is being worked with, it's safer to convert between String and ByteString through Text's encodeUtf8 and decodeUtf8 functions. The pack functions in Char8 are for ASCII only. This may bite people more than they think, say with UTF-8, which is VERY common. This fixes the broken property tests added in an earlier commit.
Contributor
|
This looks great. Thank you for this! I'll get a release out soon. |
Contributor
|
Released as string-conv-0.2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This adds a suite of property tests that expose the Char8 breakage that can occur when using Data.ByteString.Char8 pack and unpack. The PR also includes a fix for this using Text encode and decode.