API for clojure.test.generative - test.generative 1.1.0-SNAPSHOT (in development)


Full namespace name: clojure.test.generative

Overview





Public Variables and Functions



defspec

macro
Usage: (defspec name fn-to-test args & validator-body)
Defines a function named name that expects args. The defined
function binds '%' to the result of calling fn-to-test with args,
and runs validator-body forms (if any), which have access to both
args and %. The defined function.

Args must have type hints (i.e. :tag metadata), which are
interpreted as instructions for generating test input
data. Unquoted names in type hints are resolved in the
c.t.g.generators namespace, which has generator functions for
common Clojure data types. For example, the following argument list
declares that 'seed' is an int, and that 'iters' is an int in the
uniform distribution from 1 to 100:

    [^int seed ^{:tag (uniform 1 100)} iters]

Backquoted names in an argument list are resolved in the current
namespace, allowing arbitrary generators, e.g.

    [^{:tag `scary-word} word]

The function c.t.g.runner/run-iter takes a var naming a test, and runs
a single test iteration, generating inputs based on the arg type hints.

    
    
    Source
  

clojure.test.generative.runner





Public Variables and Functions



-main

function
Usage: (-main & dirs)
Command line entry point. Calls System.exit!

    
    
    Source
  


config

function
Usage: (config)
Returns runner configuration derived from system properties.

    
    
    Source
  


dir-tests

function
Usage: (dir-tests dirs)
Returns all tests in dirs

    
    
    Source
  


inputs

function
Usage: (inputs test)
For interactive use.  Returns an infinite sequence of inputs for
a test.

    
    
    Source
  


prf

var

    
Print and flush.

    
    
    Source
  


run

function
Usage: (run nthreads msec & test-containers)
Designed for interactive use.  Prints results to *out* and throws
on first failure encountered.

    
    
    Source
  


run-suite

function
Usage: (run-suite {:keys [nthreads msec progress]} tests)
Designed for test suite use.

    
    
    Source
  


serialized

function
Usage: (serialized f)
       (serialized f agt)
Returns a function that calls f for side effects, async,
serialized by an agent

    
    
    Source
  
Logo & site design by Tom Hickey.
Clojure auto-documentation system by Tom Faulhaber.