(defmacro inst-in
"Returns a spec that validates insts in the range from start
(inclusive) to end (exclusive)."
[start end]
`(let [st# (inst-ms ~start)
et# (inst-ms ~end)
mkdate# (fn [d#] (java.util.Date. ^{:tag ~'long} d#))]
(spec (and inst? #(inst-in-range? ~start ~end %))
:gen (fn []
(gen/fmap mkdate#
(gen/large-integer* {:min st# :max et#}))))))