simple-check.clojure-test documentation

*report-shrinking*

var

If true, a verbose report of the property being tested, the failing return value, and the arguments provoking that failure is emitted prior to the start of the shrinking search.

*report-trials*

var

Controls whether property trials should be reported via clojure.test/report. Valid values include:

  • false - no reporting of trials (default)
  • a function - will be passed a clojure.test/report-style map containing :simple-check.core/property and :simple-check.core/trial slots
  • true - provides quickcheck-style trial reporting (dots) via trial-report-dots

(Note that all reporting requires running quick-check within the scope of a clojure.test run (via test-ns, test-all-vars, etc.)

Reporting functions offered by simple-check include trial-report-dots and trial-report-periodic (which prints more verbose trial progress information every *trial-report-period* milliseconds.

*trial-report-period*

var

Milliseconds between reports emitted by trial-report-periodic.

defspec

macro

[name property]
[name default-times property]

Defines a new clojure.test test var that uses quick-check to verify [property] with the given [args] (should be a sequence of generators), [default-times] times by default. You can call the function defined as [name] with no arguments to trigger this test directly (i.e. without starting a wider clojure.test run), or with a single argument that will override [default-times].

trial-report-dots

fn

[{[so-far total] :simple-check.clojure-test/trial}]

Intended to be bound as the value of *report-trials*; will emit a single dot every 1000 trials reported.

trial-report-periodic

fn

[m]

Intended to be bound as the value of *report-trials*; will emit a verbose status every *trial-report-period* milliseconds, like this one:

Passing trial 3286 / 5000 for (your-test-var-name-here) (:)