Commits

Meikel Brandmeyer committed 85c314b

Allow map literals as generators

Comments (0)

Files changed (1)

src/main/clojure/clojurecheck/core.clj

                   [[] []] this)]
       (DomainValue. generators values)))
 
+  clojure.lang.IPersistentMap
+  (arbitrary
+    [this size]
+    (let [ks    (keys this)
+          gens  (vals this)
+          dvals (arbitrary gens size)]
+      (DomainValue. (zipmap ks (.domain dvals))
+                    (zipmap ks (.value dvals)))))
+
   Object
   (arbitrary [this size] (arbitrary (constantly this) size)))