Commits

Meikel Brandmeyer committed 215c275 Merge

Merge v2.0.1

  • Participants
  • Parent commits 4810d07, 1796b2b

Comments (0)

Files changed (3)

 00c8e7cbe5ff5f10d203028532bdff48d48c16f5 v1.0.0
 6d1dbb1406a7ce7f175dbe7fb94a96270b024676 v2.0.0
+4a7c8149390ec5512cf2d1382879396c8d458d48 v2.0.1

build.gradle

File contents unchanged.

src/main/clojure/clojurecheck/core.clj

         choices (map vector (keys choices) freqs)
         choose  (fn []
                   (let [dice (rand)]
-                    (some (fn [[c f]] (when (< f dice) c)) choices)))]
+                    ; XXX: c cannot be nil, because it is a generator.
+                    (some (fn [[c f]] (when (< dice f) c)) choices)))]
     (fn [size]
       ((choose) size))))
 
 
 (defn sized
   "Modify the size guidance according to f and pass it on to the
-  given generator. If f is not a function it will be taken"
+  given generator. If f is not a function it will be taken turned
+  into a function returning the given value as constant."
   {:added "2.0"}
   [f gen]
   (let [f (if (fn? f) f (constantly f))]