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

Make tests pass and improve shrinking for prop_flat_map #269

Closed
wants to merge 4 commits into from

Commits on Jul 27, 2022

  1. Remove half-open float ranges as Strategies

    The tests didn't pass, and fixing them reliably seems impossible.
    nzeh committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    70498b6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5a27ddd View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2022

  1. Implement improved shrinker for prop_flat_map

    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.
    nzeh committed Jul 28, 2022
    Configuration menu
    Copy the full SHA
    006a53a View commit details
    Browse the repository at this point in the history
  2. Update CHANGELOG

    nzeh committed Jul 28, 2022
    Configuration menu
    Copy the full SHA
    7866f6d View commit details
    Browse the repository at this point in the history