You have two possible branches for your ::fizbuzz arguments, a one-arity 
and a 3-arity. The 1-arity branch allows for the value 1, which when passed 
to the function fizzbuzz recursively calls the function fizzbuzz with the 
arguments (3 5 1) is not a valid set of values for ::fizzbuzz and so raises 
an exception.

The reason you only get the exception when you've instrumented the 
function, is because the non-conforming set of arguments is constructed in 
the 1-arity, and doesn't get checked against ::fizzbuzz unless 
instrumentation is turned on.


On Thursday, October 20, 2016 at 3:17:19 PM UTC+11, J.-F. Rompre wrote:
>
> I am trying to learn clojure.spec and tried my hand at a spec for a 
> fizzbuzz function. 
> For some strange reason, generators created for it fail the same spec 
> during clojure.spec/exercise-fn !
>
> Stranger, this happens only if the same function is first instrumented 
> using clojure.spec.stest/instrument.
> Otherwise (commenting out the instrument call), exercise-fn generates 
> compliant inputs and returns.
>
> I tried to reproduce this with a trivial example to show here but 
> couldn't, so created a gist to illustrate the issue: 
>      https://gist.github.com/KingCode/101ff425f1abd9693a7e8c4b5d389e74
>
> Thanks for any comment and enlightening, I can't wait to use spec 
> productively :)
> JF
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to