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

269 improve shrinking prop flat map #513

Open
wants to merge 4 commits into
base: 2.x
Choose a base branch
from

Conversation

matthew-russo
Copy link
Member

replaces #269. targets 2.x with breaking changes

thomaseizinger and others added 4 commits September 22, 2024 10:22
The tests didn't pass, and fixing them reliably seems impossible.
The previous shrinker always shrunk the inner strategy first.  This
seems to be the wrong thing to do in almost all non-trivial situations
(e.g., generate a vector length and then a pair of vectors of this
length).  The new shrinker shrinks the outer strategy first (e.g.,
tries to minimize the vector length first and then minimizes the entries
in the vectors).

Given the current implementation of shrinking via simplify/complicate,
I had a hard time doing this without cloning the inner strategy before
simplifying it. So there's a breaking change here because prop_flat_map
now requires the closure to produce a strategy that implements Clone.
This could have been avoided by a change in how simplify/complicate
operate, but this has the potential of breaking much more code than
adding the requirement that the inner strategy is clonable.
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.

3 participants