genUnicodeString generates invalid unicode
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- testing-qa
Research direction
Start with the generators in src/Data/Char/Gen.purs and src/Data/String/Gen.purs, then reproduce the failure using the linked utf8 encoding/decoding QuickCheck test. Determine how the generators should avoid unpaired surrogates while still covering valid Unicode. Done means generated strings are valid Unicode and the linked property test no longer fails.
Written by the indexing model from the issue text.
Description
The unicode character generator for unicode characters is picking a random CodePoint in the BMP. The unicode string generator just generates an arbitrary array of such code points and turns it into a string. It turns out that this can generate invalid unicode via unpaired surrogates: https://unicode.org/faq/utf_bom.html#utf16-7
One solution here would be to restrict the code points to avoid such cases, another would be to figure out a more complicated but correct way to generate unicode which cannot be done CodePoint by CodePoint.
For context I discovered this while trying to write a quickcheck test for utf8 encoding/decoding, you can see the failing test here
- Dominant language
- PureScript
- Stars
- 57
- Forks
- 76
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from purescript/purescript-strings
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
purescript/purescript-strings#176 · 6 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
purescript/purescript-strings#171 · 3 comments · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
purescript/purescript-strings#170 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
purescript/purescript-strings#169 · 7 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
purescript/purescript-strings#164 · 2 comments ·
All issues in purescript/purescript-strings
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
from:qa priority:P2 reliability tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
spec-kitty/spec-kitty#4874 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
duckdb/duckdb-python#627 ·
-
area: dogs bug priority: P3 silent failure test-code
Difficulty 2/5 1-3 hours Newbie friendliness 88/100