clojure-spec

About: http://clojure.org/about/spec Guide: http://clojure.org/guides/spec API: https://clojure.github.io/spec.alpha/clojure.spec.alpha-api.html
telekid 2020-02-12T23:25:55.186500Z

Instrumentation / generation question. In the following 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 fdef of inner that the generated values should be some known function of the input? gist here: https://gist.github.com/telekid/01b0aed73511167c337794bc286908cf