Comment made by: gfredericks
It's certainly adequate to reproduce in theory, but I don't know of any built in mechanism that makes this easy. Here's what I end up doing:
Given this:
`
(defspec foo
(prop/for-all [x gen]
(f x)))
`
and after getting a failure with a 50-line shrunk value (e.g. {{:bar}}), I manually pretty-print it and paste it back into my file like so:
`
(def shrank
':bar)
(defspec foo
(prop/for-all [x #_gen (gen/return shrank)]
(f x)))
`
And now I can run {{(foo 1)}} to re-run with the failing value.
This awkwardness is partly due to three facts:
- My generators create large unwieldy values
- My property is a large body of code rather than a single function
- There's no easy way to test a property on a specific value
I could mitigate some of the pain by fixing #2 -- having each one of my tests split into a {{defspec}} / {{prop/for-all}} and a plain function. But #1 is not easy to fix, and having a small tuple is rather nicer for me.
I've already written a POC for this and it's working rather well. I used the term {{:key}} to refer to the tuple, so the term doesn't conflict with {{:seed}}. I end up calling the test like {{(foo 0 :key [329489249329323 19 []])}}, but I'll probably think up something else that doesn't require passing a dummy first arg.