Open SevereOverfl0w opened 9 months ago
After poking at this a little bit, it seems that we'd need upstream changes in test.check to make this work. When doing a call-gen
in quick-check the exception would need to be caught and some handling put in place. Calling :reporter-fn
with any relevant information before rethrowing the exception seems like the minimal set of changes to me.
Okay; we can leave this open and you or somebody else could pursue those changes in test.check.
@gfredericks I took a shot at it. https://github.com/gfredericks/test.chuck/pull/80
What do you think about the test.check changes? Worth proposing on TCHECK-159?
I'm not maintaining test.check anymore, so my opinion doesn't matter too much.
Firstly, thanks @gfredericks for all the years of maintainership. In my book, test.check under your direction has been the most successful Clojure library of them all. All that to say, I really appreciate your work and congratulations on an amazing tenure.
Secondly, my hit rate on getting patches merged from JIRA is probably about 5%. Would you consider a patch to test.chuck with this definition of quick-check
, and then using it in checking
?
Thanks for the kind words!
Copypasting the definition of quickcheck into this library sounds like it could gen gnarly in the future if implementation details in test.check change.
Is there no way to do this in test.chuck, perhaps by wrapping generators with a fmap that has a try/catch, and then wrapping the checking expression similarly? That'd amount to turning a generator-exception into a test failure, which is a bit weird, but would at least result in the seed being output.
@gfredericks great idea, I will try it.
If generation fails during the bindings phase of the
checking
macro any seed information is lost. This makes it difficult to reproduce failures.Produces this output: