(->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.
(->examples test-thing ge? body)
Takes in an eg body, and returns example pairs.
Takes in an eg body, and returns example pairs.
(->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>'.
(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.
(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.
(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.
(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.
(eg-helper [fn-sym & body] ge?)
Common logic between 'eg' and 'ge'.
Common logic between 'eg' and 'ge'.
(ex & body)
Test arbitrary expressions against corresponding expected values. See readme for usage.
Test arbitrary expressions against corresponding expected values. See readme for usage.
(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.
(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.
(ge & args)
Like 'eg' but example components are reversed. See readme for usage.
Like 'eg' but example components are reversed. See readme for usage.
(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.
(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.
(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.
(rm-lead-colon s)
Motivation: 'name' does not work for processed strings.
Motivation: 'name' does not work for processed strings.
(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.
(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.
(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 '!'.
(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.
(variadic-bang? token)
Checks if token is a list with '!' as first element.
Checks if token is a list with '!' as first element.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close