269 improve shrinking prop flat map#513
Open
matthew-russo wants to merge 4 commits intoproptest-rs:2.xfrom
Open
269 improve shrinking prop flat map#513matthew-russo wants to merge 4 commits intoproptest-rs:2.xfrom
matthew-russo wants to merge 4 commits intoproptest-rs:2.xfrom
Conversation
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.
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.
replaces #269. targets 2.x with breaking changes