评论者:gfredericks
万一我没有时间制作补丁,我认为这样的生成器可以作为一个不错的起点
`
(def gen-bigint
(gen/sized
(fn [size]
(let [large-integer (gen/resize size gen/large-integer)]
;; scaling gives us relatively small vectors, but using
;; the resized large-integer above means the numbers in
;; the small vectors will still be big
(gen/scale #(+ 2 (/ % 20))
(gen/fmap (fn [xs] (+ (bigint (first xs)) (reduce * (map bigint (rest xs)))))
(gen/not-empty (gen/vector large-integer)))))))) ```