(defn bigint?
"Returns true if n is a BigInt"
{:added "1.9"}
[n] (instance? clojure.lang.BigInt n))
The generator is the tricky bit. test.check doesn't have a generator for bigints, just large-integer for things in long range. I think we'd want numbers beyond long range in a bigint generator (as that's a likely place where bugs might lie). Making a really high-quality bigint generator (with good growth and shrinking characteristics) is something that needs more thought.
Add
bigint?and spec.gen support.This part is easy:
(defn bigint? "Returns true if n is a BigInt" {:added "1.9"} [n] (instance? clojure.lang.BigInt n))The generator is the tricky bit. test.check doesn't have a generator for bigints, just
large-integerfor things in long range. I think we'd want numbers beyond long range in a bigint generator (as that's a likely place where bugs might lie). Making a really high-quality bigint generator (with good growth and shrinking characteristics) is something that needs more thought.http://clojure.github.io/test.check/clojure.test.check.generators.html#var-large-integer