-
Notifications
You must be signed in to change notification settings - Fork 588
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
Increase variation in Unicode character generation #1621
Conversation
b678f58
to
f4f4635
Compare
f4f4635
to
fb7b08b
Compare
dad21c7
to
33c6223
Compare
OK! I've tidied this up and ensured that the increased variety in generation does not change shrinking. Ready for another review 😄 |
33c6223
to
0ed071f
Compare
b03bfaa
to
79f85fa
Compare
38284e6
to
aa894b5
Compare
Hmm. After digging into this, it looks like it's not fully broken - instead, there are some tests that don't reliable shrink to a fixpoint within the 500 shrink limit. @DRMacIver, any idea what I should do about that? |
aa894b5
to
b0b97b9
Compare
b0b97b9
to
396e56c
Compare
When passed an alphabet of characters (not a strategy), we can do much better for shrinking than simply sampling from it - delegating to characters() if possible or sorting before sampling otherwise.
396e56c
to
f1f951d
Compare
I'm going to close this issue for now, as while the approach is promising there is also something of a clash between the generation and shrinking steps and I simply don't want to work on the frustration last ~5% of the problem at the moment. |
Rebased and (somewhat) updated version: master...Zac-HD:weird-text - shrinking isn't quite right at the moment but everything else seems to be working. |
This patch substantially increases the variety of examples from the
characters()
strategy. Instead of generating directly from codepoint,characters()
now selects a Unicode category and then a code point within that category. However the shrink target is unchanged, as the choice of category 'shrinks open' to allow codepoint-wise minimisation during shrinking.I've extracted the unrelated cleanups and refactoring as #1660 - it would be great if that can be reviewed and merged soon, so I can rebase on it.
Closes #1401 and closes #341.