评论由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)))))))) ```