Commits

Meikel Brandmeyer  committed 160cf6f

Fix bug in frequency

  • Participants
  • Parent commits a40b24a

Comments (0)

Files changed (1)

File 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))))