Liking cljdoc? Tell your friends :D

clj-toolbox.test-utils

Utilities for making it easier to write tests. defntest and defntest-1 are macros for simplifying writing tests for simple functions that require no extra setup, just checking expected outputs against inputs. test-dir creates a temp directory that is named after the current test

Utilities for making it easier to write tests.
`defntest` and `defntest-1` are macros for simplifying writing tests for simple functions that require no extra setup, just checking expected outputs against inputs.
`test-dir` creates a temp directory that is named after the current test
raw docstring

defntestcljmacro

(defntest f & test-pairs)

Defines a series of tests for function f Each test-pair consists of args expected where args is a vector of arguments to f and expected is the expected return value of (apply f args)

Defines a series of tests for function f
Each test-pair consists of
  args expected
where args is a vector of arguments to f and expected is the expected return value of (apply f args)
sourceraw docstring

defntest-1cljmacro

(defntest-1 f & test-pairs)

Defines a series of tests for 1-arity function f Each test-pair consists of arg expected where arg is a single argument to f and expected is the expected return value of (apply f [arg])

Defines a series of tests for 1-arity function f
Each test-pair consists of
  arg expected
where arg is a single argument to f and expected is the expected return value of (apply f [arg])
sourceraw docstring

make-test-bodycljmacro

(make-test-body expected f input)
source

test-dirclj

(test-dir)

Creates an approriately named temp directory for the current test

Creates an approriately named temp directory for the current test
sourceraw docstring

with-expected-outputcljmacro

(with-expected-output expected & body)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close