gen/choose introduced in
0.8.1.gen/int would sometimes generate doubles.cljs.* → clojure.*cljs.test.check.cljs-test → clojure.test.check.clojure-testjava.util.SplittableRandom algorithm, instead of
java.util.Random and goog.testing.PsuedoRandom.clojure.test.check.generators:
scalegeneratedefspec is used.make-rngnot-falsey-or-exception?make-genbind-helperrecursive-helperbinding-varsbinding-gensgen/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-nsgen/symbol-nschoose bug introduced in 0.5.4, the upper-bound was not inclusive.exclude-nth function (#50)one-ofno-shrink and shrink-2 combinatorsinterpose-twice-the-length test (#52)defspectuple 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/bytesgen/such-thatsimple-check.clojure-test/defspecdo to defspec bodyCan you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |