test-check 2020-02-24

Is there a way to know if the output from quick-check was the result of a generator throwing an exception versus the function throwing an exception?

I don't think generator exceptions get caught

Ah. I'm calling via spec's check which does not throw in that case which explains the weird looking output.

Does it catch exceptions?

It appears so. When a gen throws, it attaches the generator exception on the :result key and nothing else.

Is it calling the generator manually?

Or it just catches everything?

Hmm actually that's not even a generator throwing. It's a gen throwing while being constructed.

Bad test case. Will see what happens when a gen actually throws.

I don't like that return value

I'm checking for it like this haha

(and (instance? Throwable (:result ret))
     (nil? (:shrunk ret)))

Same thing when the gen throws

Different part of the code returns the same thing?

I don't think there's any way for me to differentiate an exception from a generator throwing while construction and a generator throwing while generating.

Except the stack trace 😉

Yeah... Not sure where it's catching the gen throwing case.

It's not in that ns. Must be doing it elsewhere.