gen/intgen/pos-intgen/neg-intgen/s-pos-intgen/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 seedprop/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 1000.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/letgen/uuidgen/doublegen/large-integergen/setgen/sorted-setgen/vector-distinctgen/vector-distinct-bygen/list-distinctgen/list-distinct-bygen/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-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? These fine people already did:
Reid Draper, Gary Fredericks & Alex MillerEdit 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 |