-
Notifications
You must be signed in to change notification settings - Fork 30
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
Way to start a recheck from a fully shrunk case? #332
Comments
You are not missing anything. That is the intended behavior. The idea of directly rechecking the shrunken case is interesting though. I will think about that and also test your provided code later. |
We could create a bit vector that says if each input in the shrinking process passes the test ( Now that I have this idea, I am excited to implement it. Not sure at the moment when I will have time though. |
I wrote some code in an attempt to solve this problem, but I can't figure out how to avoid executing the test while traversing the shrink tree. Can anyone explain how this might be done? |
jetCheck, a PBT library for Java, has this feature.
|
@moodmosaic, does Haskell Hedgehog have this feature? |
@TysonMN no we don't have that yet. |
Ok, thanks for letting me know. I will try again this week to implement this feature. |
This feature is now available in version 0.12.0. |
Awesome, great work, @TysonMN. |
In some cases, it can be beneficial to inspect in a debugger the behavior of the function under test. If it is sufficiently complex, this is better done using the input data that is as simple as possible - i.e. shrunken. Debugging is often done by seting breakpoints, so it is reasonable to expect the breakpoints to be hit starting directly with the shrunk unput. But I was unable to find a way of making it so. The reproduction info that Hedgehog prints seems to lead to the failing case that was found first, not to the result of shrinking. Am I missing something?
Here is the repro in code. We check a function with clear failure conditions and we log both the input and the number of calls:
Initial run, getting the seed for recheck:
Test run, see if we hit a shrunk case or just any failing case on the first invocation:
The text was updated successfully, but these errors were encountered: