gen/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?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close