Welcome! Please see the About page for a little more info on how this works.

0 votes
in Spec by

I tried to generate some data with {{exercise-fn}} but could not do it because I need to carry my own custom generators.
At the moment though, there is no way to add them, like an optional parameter.

3 Answers

0 votes
by

Comment made by: alexmiller

Patch would be welcome for this!

0 votes
by

Comment made by: laczoka

First attempt to form a patch.

I am unsure whether it is ok to use the overloaded 3rd argument approach or take a keyword arg approach for the optional arguments.

i.e. ((link: sym-or-fn n & {:keys [fspec gen)}])

On the other hand, it only make sense to pass one or the other and given sym-or-fn, fspec-or-gen seems appropriate.

Currently the test suite for c.spec is lacking, I'm happy to add a few example-based tests for exercise-fn, once the approach is approved.
Also

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-2038 (reported by arichiardi)
...