metosin / malli

High-performance data-driven data specification library for Clojure/Script.
Eclipse Public License 2.0
1.43k stars 204 forks source link

`:double` generates Long if `:min` is Long #1034

Closed frenchy64 closed 4 weeks ago

frenchy64 commented 2 months ago

I think this is a quirk of gen/double-gen*. Perhaps we could throw here or coerce the bounds to Double.

(defn shrink [?schema]
  (-> (quick-check 1 (for-all [s (mg/generator ?schema)] false) {:seed 0})
      :shrunk
      :smallest
      first))

((juxt class identity) (shrink [:double {:min 3}]))
;=> [java.lang.Long 3]