We're updating the issue view to help you get more done. 

[spec] the generator for "inst?" generate inst's that can be readed after print

Description

Here:
https://github.com/clojure/spec.alpha/blob/master/src/main/clojure/clojure/spec/gen/alpha.clj#L160

inst? generator is defined as (fmap #(java.util.Date. %) (large-integer))

But inst's generated from integer's larges then 253402300799999 can be readed

(edn/read-string (pr-str (new java.util.Date (inc 253402300799999)))) ;; throws: Unrecognized date/time syntax: 10000-01-01T00:00:00.000-00:00

One line reproduce:
clj -Srepro \ -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.10.0"} org.clojure/test.check {:mvn/version "0.10.0-alpha3"}}}' \ -e "(do (require '[clojure.test.check.generators :as gen] '[clojure.spec.alpha :as s]) (gen/generate (gen/vector (s/gen inst?)) 120 6))"

[#inst "1970-01-01T01:24:38.462-00:00" #inst "1969-12-06T11:54:24.666-00:00" #inst "820499-07-18T05:28:23.398-00:00" #inst "1969-08-08T01:04:53.430-00:00" #inst "1970-01-01T00:00:00.000-00:00" #inst "1970-01-01T00:00:00.001-00:00"]

the 3 el, if printed, can be readed.

If the solution for this is "allow reader to read huge dates", please consider transit/cljs patches.

The actual limits of reader are:
[(new Date -62135769600000) (new Date 253402300799999)]
Use (gen/large-integer* {:min -62135769600000 :max 253402300799999}) is a possible patch, but the actual gen generate just 1970+ (positive) dates.

Environment

org.clojure/clojure {:mvn/version "1.10.0"}
org.clojure/test.check {:mvn/version "0.10.0-alpha3"}}

Status

Assignee

Unassigned

Reporter

Enzzo Cavallo

Approval

None

Patch

None

Priority

Minor