gen/int
gen/pos-int
gen/neg-int
gen/s-pos-int
gen/s-neg-int
Added a gen/small-integer
to replace gen/int
, and the
docstrings for all the deprecated generators suggest alternativesgen/size-bounded-bigint
and gen/big-ratio
, both jvm-only*-equatable
variants of gen/simple-type
,
gen/simple-type-printable
, gen/any
, and gen/any-printable
;
the only current difference is that the new generators never generate
a NaN
, and so they should always be =
to equivalent objectsgen/frequency
doesn't shrink to zero-weighted entries
(TCHECK-129):/
)clojure.test/report
(TCHECK-125)gen/let
introduced in alpha1
(TCHECK-133)reporter-fn
calls to more
closely match the data returned from quick-check
, to minimize
confusionfor-all
docstring
(TCHECK-121):result
key to be more backwards compatible, added a
:pass?
key, renamed results/passing?
to results/pass?
(TCHECK-142)quick-check
return data
(TCHECK-95)gen/generate
, the seed
prop/for-all
so that returned
exceptions are treated as thrown exceptions
(TCHECK-131):reporter-fn
callback for the quick-check
function,
fixing TCHECK-33
(this item is the most subject to change before the final release)recursive-gen
to be more careful about sizing
(TCHECK-83)gen/any
and gen/any-printable
can generate sets nowclojure.test.check.clojure-test/*default-opts*
gen/frequency
can shrink to earlier generators
(TCHECK-114)gen/such-that
can take an ex-fn
option to customize exceptionsgen/let
supports map bindings to specify independence
(TCHECK-98)gen/sample
uses size up to 200
instead of 100
0.9.0 contains an assortment of new generators, and is the first
release that requires Clojure 1.7.0 (due to using cljc
files to unify
the clj & cljs code).
gen/let
gen/uuid
gen/double
gen/large-integer
gen/set
gen/sorted-set
gen/vector-distinct
gen/vector-distinct-by
gen/list-distinct
gen/list-distinct-by
gen/map
now takes sizing options, the same as the preceding
collection generatorsgen/choose
introduced in
0.8.1.gen/int
would sometimes generate doubles.cljs.*
→ clojure.*
cljs.test.check.cljs-test
→ clojure.test.check.clojure-test
java.util.SplittableRandom
algorithm, instead of
java.util.Random
and goog.testing.PsuedoRandom
.clojure.test.check.generators
:
scale
generate
defspec
is used.make-rng
not-falsey-or-exception?
make-gen
bind-helper
recursive-helper
binding-vars
binding-gens
gen/shuffle
to work on anything that can be turned into a
sequence.defspec
macro could only accept map or
numeric literals as options, instead of a symbol.Add a shuffle
generator, which generates permutations of a given
sequence.
Rename alpha-numeric
functions to alphanumeric
. char-alpha-numeric
and string-alpha-numeric
are now deprecated in favor of
char-alphanumeric
and string-alphanumeric
. The deprecated versions
will be removed in a future version of test.check
.
Update the defspec
macro to allow an optional map argument, which
allows for the setting of :seed
, :num-tests
and :max-size
. Examples
below:
(defspec run-with-map {:num-tests 1} (prop/for-all* [gen/int] (constantly true)))
(defspec run-with-map {:num-tests 1
:seed 1}
my-prop)
Provide better error-messages for the misuse of generator combinators. Many of the functions now test that their arguments are of the appropriate type, and will throw a runtime error otherwise.
Print test failures that can be copied directly. For example, print the
empty string as ""
, instead of a blank value. This is fixed by using
prn
instead of println
.
gen/recursive-gen
function for writing recursive generatorsgen/keyword-ns
gen/symbol-ns
choose
bug introduced in 0.5.4, the upper-bound was not inclusive.exclude-nth
function (#50)one-of
no-shrink
and shrink-2
combinatorsinterpose-twice-the-length
test (#52)defspec
tuple generator now creates tuple types (from clj-tuple
)
gen/tuple
now takes var-args, instead
of a vector of arguments. So change:(gen/tuple [gen/int gen/boolean])
to
(gen/tuple gen/int gen/boolean)
Tuples will now retain their size when shrunk.
add a ratio
generator
correctly shrink empty lists
switch to codox-md
for documentation
diff
functiongen/byte
and gen/bytes
gen/such-that
simple-check.clojure-test/defspec
do
to defspec
bodyCan you improve this documentation? These fine people already did:
Reid Draper, Gary Fredericks & Alex MillerEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close