-
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
Fix for counterexample crashing bug #327 #328
Conversation
The build fails because when compiled by Fable. This is related to a test that I added. @ThisFunctionalTom, do you have an opinion about how to fix this? Of course the brute force solution is to have Fable ignore this test. |
I guess we can make a pull request in mocha to also implement |
I just made a pull request for it. |
That PR seems like the right fix. Thanks @ThisFunctionalTom. |
If you are in a hurry I guess we could extend the Expect module in FSharp.Hedgehog with a |
I don't think there is any hurry. I would prefer to wait for that PR to be merged and a release to be made. |
Sorry, have not got time for this. The pull request is already merged but we still have some troubles because we do not use the Except module from Mocha. I will look into it on the weekend. |
Finally had some time to look into it. The first problem is that Fable.Mocha does not have all the assertions from the Expect module as Expecto does. The If we are using only a few assertions we can copy the implementation from Expecto into TestDsl (not a really big fan of this solution) or The second problem is that we must open the correct namespace depending on
The pull request with the fixed How should we proceed? What do you think? |
I would prefer if any assertions we need were added to Fable.Mocha.
We don't have very many test files. I think it is fine to add the code in your comment to the top of each file. |
OK. I will change my pull request for your pull request (:trollface:) accordingly. Yeah, about that... I am not sure how much of Expecto Would it be OK to copy the implementation of the assertions to our TestDsl.fs file into |
Yes. This seems fine. |
d76d81b
to
0450f76
Compare
The most recent commit in this branch adds a workaround for the Fable compiler so that the tests pass. This is now ready to be merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a few things, mostly around exposing new public API.
e23f434
to
184b321
Compare
@adam-becker, I think I addressed all the comment in your review. I left them unresolved so that is easy for you to double check them. When you are satisfied, I would prefer to squash the commits a bit. Then we can merge. |
004e457
to
5eadd06
Compare
I decided to squash the commits. I think this is ready to merge. |
…iven to Property.bindGen hedgehogqa#327
5eadd06
to
2c9b721
Compare
Rebased on |
Looks good to me! Thanks @TysonMN |
Fixes #327
I think this PR fixes the bug where an exception isn't caught when checking a
Property<_>
containingcounterexample
. I got the idea for this fix by looking atProperty.forall
, which is the only other place thatProperty.counterexample
is called. In the last commit, I removed the exception handling code fromProperty.forall
since it is now happening inProperty.bind
.How does this compare to the code in Haskell Hedgehog?
@AlexeyRaga, does the branch in this PR give the behavior that you expect?