Liking cljdoc? Tell your friends :D

eg


->example-testclj/smacro

(->example-test fn-sym examples focus-metas- focus?)

Creates a clojure.test test for function being tested. Assertions are generated under the test using provided examples. Test name is derived from the fully qualified name of function under test, and by appending '-test' to it. Test may not run depending on its focus state, and of other function tests.

Creates a clojure.test test for function being tested.
Assertions are generated under the test using provided examples.
Test name is derived from the fully qualified name of function under test, and by appending '-test' to it.
Test may not run depending on its focus state, and of other function tests.
source (clj)source (cljs)raw docstring

->examplesclj/s

(->examples test-thing ge? body)

Takes in an eg body, and returns example pairs.

Takes in an eg body, and returns example pairs.
sourceraw docstring

->expression-testclj/smacro

(->expression-test examples)

Creates a clojure.test test for expressions being tested. Assertions are generated under the test using provided expressions. Test name is created as 'eg-test-<rand-id>'.

Creates a clojure.test test for expressions being tested.
Assertions are generated under the test using provided expressions.
Test name is created as 'eg-test-<rand-id>'.
source (clj)source (cljs)raw docstring

->test-nameclj/s

source

alter-test-var-update-fnclj/s

(alter-test-var-update-fn test-v)

Meant for use with 'alter-var-root' to decorate 'clj.test/test-var' with test check on focus state.

Meant for use with 'alter-var-root' to decorate 'clj.test/test-var' with
test check on focus state.
sourceraw docstring

assoc-focus-metasclj/s

(assoc-focus-metas focus-metas- fn-meta fn-sym)

Creates a new entry in fn to focus? map for qualified function in params.

Creates a new entry in fn to focus? map for qualified function in params.
sourceraw docstring

cljs-safe-namespaceclj/s

(cljs-safe-namespace thing)

Like 'namespace', but occurrences of '.' are replaced with '-', to prevent compilation error in cljs. Used to create an unambiguous test name.

Like 'namespace', but occurrences of '.' are replaced with '-', to prevent compilation error in cljs.
Used to create an unambiguous test name.
sourceraw docstring

dont-care?clj/s

source

egclj/smacro

(eg & args)

Test function using examples of parameters / expected value. See readme for usage.

Test function using examples of parameters / expected value. See readme for usage.
source (clj)source (cljs)raw docstring

eg-helperclj/smacro

(eg-helper [fn-sym & body] ge?)

Common logic between 'eg' and 'ge'.

Common logic between 'eg' and 'ge'.
source (clj)source (cljs)raw docstring

exclj/smacro

(ex & body)

Test arbitrary expressions against corresponding expected values. See readme for usage.

Test arbitrary expressions against corresponding expected values.
See readme for usage.
source (clj)source (cljs)raw docstring

examples-accclj/s

(examples-acc [parts part] token)

Accumulates examples, mainly taking into account operator used in example.

Accumulates examples, mainly taking into account operator used in example.
sourceraw docstring

ffilterclj/s

(ffilter pred coll)
source

fill-dont-caresclj/s

(fill-dont-cares examples)

Takes in example pairs, and fills every occurrence of a don't care with values from other examples. Each '' don't care occurrence is replaced with a value from another example at the same args position. Each named don't care (prefixed with '$'), is replaced the same way as in '', then propagated to every occurrence under its expected value.

Takes in example pairs, and fills every occurrence of a don't care with values from other examples.
Each '_' don't care occurrence is replaced with a value from another example at the same args position.
Each named don't care (prefixed with '$'), is replaced the same way as in '_', then propagated to every occurrence under
its expected value.
sourceraw docstring

focus-metasclj/s

source

geclj/smacro

(ge & args)

Like 'eg' but example components are reversed. See readme for usage.

Like 'eg' but example components are reversed. See readme for usage.
source (clj)source (cljs)raw docstring

map-dregsclj/s

(map-dregs f & colls)

Like map but when there is a different count between colls, applies input fn to the coll values until the biggest coll is empty.

Like map but when there is a different count between colls, applies input fn
to the coll values until the biggest coll is empty.
sourceraw docstring

named-dont-care?clj/s

(named-dont-care? thing)
source

operatorsclj/s

source

parse-exampleclj/s

(parse-example example ge?)

Normalizes an 'eg/ge' example's operator, and order of function parameters vs expected result.

Normalizes an 'eg/ge' example's operator, and order of function parameters vs expected result.
sourceraw docstring

parse-expressionclj/s

(parse-expression expr)

Normalizes an 'ex' expression's operator, and order of test expression vs expected result.

Normalizes an 'ex' expression's operator, and order of test expression vs expected result.
sourceraw docstring

rm-lead-colonclj/s

(rm-lead-colon s)

Motivation: 'name' does not work for processed strings.

Motivation: 'name' does not work for processed strings.
sourceraw docstring

set-eg!clj

(set-eg! & egs)

Interns 'eg', 'ge', and 'ex' in clojure.core, to be able to use those forms without requires in test ns. Then, refreshes all namespaces for cases when a test namespace is required before this function is called.

Interns 'eg', 'ge', and 'ex' in clojure.core, to be able to use those forms without requires in test ns.
Then, refreshes all namespaces for cases when a test namespace is required before this function is called.
sourceraw docstring

set-eg-no-refresh!clj

(set-eg-no-refresh! egs)

Interns 'eg', 'ge', and 'ex' in clojure.core, to be able to use those forms without requires in test ns.

Interns 'eg', 'ge', and 'ex' in clojure.core, to be able to use those forms without requires in test ns.
sourceraw docstring

spec-eg-accclj/s

(spec-eg-acc [parts part] token)

Accumulates examples for a spec, mainly because some could appear negated using '!'.

Accumulates examples for a spec, mainly because some could appear negated using '!'.
sourceraw docstring

test?clj/s

(test? focus-metas focus?)

Used to determine if function will be tested based on its focus state, and the focus state of the other function tests.

Used to determine if function will be tested based on its focus state,
and the focus state of the other function tests.
sourceraw docstring

variadic-bang?clj/s

(variadic-bang? token)

Checks if token is a list with '!' as first element.

Checks if token is a list with '!' as first element.
sourceraw docstring

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

× close