“s/inst-in”和“s/int-in”生成器基于从0增长的gen/large-integer*。
`
(require '[clojure.spec.alpha :as s] '[clojure.spec.gen.alpha :as gen])
(gen/sample (s/gen (s/int-in 0 100)))
;;=> (1 0 1 1 1 0 1 1 72 1)
(gen/sample (s/gen (s/inst-in #inst "2001-01-01" #inst "2001-12-31")))
;;=> (#inst "2001-01-01T00:00:00.000-00:00" #inst "2001-01-01T00:00:00.000-00:00" #inst "2001-01-01T00:00:00.001-00:00" #inst "2001-01-01T00:00:00.001-00:00" ...)
`
建议:相反,“s/inst-in”应使用均匀分布生成器
After on same
`
(26 16 65 96 63 37 31 4 94 9)
(#inst "2001-03-03T04:51:43.702-00:00"
#inst "2001-07-25T07:13:03.224-00:00"
#inst "2001-03-31T18:28:41.625-00:00"
#inst "2001-04-17T19:33:14.176-00:00"
#inst "2001-01-14T07:03:08.521-00:00"
#inst "2001-06-06T09:52:03.421-00:00" ...)
`
补丁:clj-2179.patch