-
Notifications
You must be signed in to change notification settings - Fork 3
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
Recheck executes test way more times than expected #7
Comments
I believe this is an upstream issue. |
I no longer believe this is an upstream issue. The problem is with this code - I need to return unit from inside the Property to satisfy the CE. Currently not sure how to do that. My best attempt |> toProperty // line 162
|> Property.bind (fun () ->
property {
return () // compilation error
}
) has the following compilation error:
Using |
Maybe lines 169-172 should be Property.check <| property {
let! args = gens
inkove args
return ()
} |
But that can't be right because it is ignoring logic that rechecks or not. I also don't understand |
If it is none of these, it's a The invoke on 152 only serves as an arg to |
So I think the code I suggested should be "pushed down". Do you know where? I think we don't want to call |
This solution requires |
I expect the fix is a change to this project. I would be very surprised if the proper fix was a change to Hedgehog. |
You treat I am thinking of removing the special treatment of Or, I could throw a custom exception if the value is |
Yes. Though I wouldn't necessarily drop support in this library if Hedgehog drops special treatment of bool. My philosophy with this library is to try to make the experience of devs easier - it is, after all, "Hedgehog with convenience attributes for xUnit.net". Correctness is your domain :) I already do special casing for tests that return async/task/result. Why not bool? Since not returning a value from a property CE results in inefficient rechecking, and since this library automatically returns for you, I kinda fancy the idea that this library is the recommended way of using Hedgehog :P
Hah - I know we talked about using |
Should be fixed with the 0.5.0 release. |
This executes the test once:
And this executes the test
128667
times, always with the same values:Changing a number of tests in
Property
attribute (I tried[Property(1)]
) doesn't seem to have any affect on this behaviour.Expected: test case is executed once in both cases :)
The text was updated successfully, but these errors were encountered: