(checking name num-tests-or-options bindings & body)
A macro intended to replace the testing macro in clojure.test with a generative form. To make (testing "doubling" (is (= (* 2 2) (+ 2 2)))) generative, you simply have to change it to (checking "doubling" 100 [x gen/int] (is (= (* 2 x) (+ x x)))).
You can optionally pass in a map options instead of the number of tests,
which will be passed to clojure.test.check/quick-check
, e.g.:
(checking "doubling" {:num-tests 100 :seed 123 :max-size 10} [x gen/int] (is (= (* 2 x) (+ x x))))
For background, see http://blog.colinwilliams.name/blog/2015/01/26/alternative-clojure-dot-test-integration-with-test-dot-check/
A macro intended to replace the testing macro in clojure.test with a generative form. To make (testing "doubling" (is (= (* 2 2) (+ 2 2)))) generative, you simply have to change it to (checking "doubling" 100 [x gen/int] (is (= (* 2 x) (+ x x)))). You can optionally pass in a map options instead of the number of tests, which will be passed to `clojure.test.check/quick-check`, e.g.: (checking "doubling" {:num-tests 100 :seed 123 :max-size 10} [x gen/int] (is (= (* 2 x) (+ x x)))) For background, see http://blog.colinwilliams.name/blog/2015/01/26/alternative-clojure-dot-test-integration-with-test-dot-check/
(for-all bindings & body)
An alternative to clojure.test.check.properties/for-all that uses clojure.test-style assertions (i.e., clojure.test/is) rather than the truthiness of the body expression.
An alternative to clojure.test.check.properties/for-all that uses clojure.test-style assertions (i.e., clojure.test/is) rather than the truthiness of the body expression.
(qc-and-report-exception final-reports num-tests-or-options bindings & body)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close