Thank you Rich!
Op di 31 mei 2016 om 19:12 schreef Rich Hickey :
> You are not labeling your preds, so ::not-predicate is taken as the label
> for ::and-predicate etc.
>
> Also, tuples are not labeled:
>
> (require '[clojure.spec :as s])
> (require '[clojure.spec.gen :as gen])
>
> (s/def ::atom s
You are not labeling your preds, so ::not-predicate is taken as the label for
::and-predicate etc.
Also, tuples are not labeled:
(require '[clojure.spec :as s])
(require '[clojure.spec.gen :as gen])
(s/def ::atom string?)
(s/def ::predicate (s/or
:not ::not-predicate
Hi Gary,
Thanks for the feedback. I've tried it with test.check itself and I get
better results (see below). So I'm guessing clojure.spec needs different
input or it works differently underneath.
Thanks,
Jeroen
(require '[clojure.test.check :as tc])
(require '[clojure.test.check.generators :as g
At a glance, this is probably the normal increasing-size behavior of
test.check, and the bias should only be present for the first few samples.
E.g., if you do a (take 1000 (gen/sample ...)), it should be more uniform.
Whether it's a real problem depends on how you're running your tests. I
have
I'm trying to generate logical predicates in order to test a function that
should return the predicate in DNF. The generation seems to be biased
towards one of the predicates. What am I doing wrong?
(require '[clojure.spec :as s])
(require '[clojure.spec.gen :as gen])
(s/def ::atom string?)
(s/d