Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Here's the basic issue: When using viewSeed, we need to put an initialSeed in the Gen.Parameters used to evaluate the Prop, so we can recover the seed later and display it. So far, so good. In some cases, we need to "slide" the seed that's embedded in the parameters, so we don't reuse it. Any time we need to evaluate several properties and don't want identical RNG state (which could lead to identical inputs) we need to slide. We were missing a "slide" in flatMap -- we were reusing the same parameters in both cases. Since flatMap was used to define && (via for-comprehension) that meant that when you said p0 && p1, you'd use the same seed for both if viewSeed was set. Refined's property was unusual, but valid. Basically, one property had (x >= 0) ==> and one had (x < 0) ==>. So no single x value would satisfy both, but on average you'd satisfy each 50% of the time, and together you'd get a non-discarded case about 25% of the time. Previously, this worked OK. But since 1.14.0 we started always displaying seeds. This meant that the bug associated with failing to slide manifested, and we always generated the same x value for both sides of the property. This meant we ended up discarding every x generated. The fix was to slide correctly in this case. I also added a toString to Gen.Parameters which was missing, since this helped with debugging.
- Loading branch information