Commits

Meikel Brandmeyer  committed 85c314b

Allow map literals as generators

  • Participants
  • Parent commits 71e2634

Comments (0)

Files changed (1)

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