I’m wondering if it’s possible to generate values of a stubbed
fdef such that they are a function of its arguments.
Concrete example: In this gist, an outer function calls an inner function twice with the same value (
i). I want to write an
fdef for the outer function, using a
:fn predicate to assert that the return from the two calls to the inner fn are identical. However, when I try to stub the call to
inner with instrumentation, the generated values returned by
inner ’s stub are (sensibly) different. Is there any way to express on the
inner that the generated values should be some known function of the input?