Liking cljdoc? Tell your friends :D

clara.tools.testing-utils

clj

Internal utilities for testing clara-rules and derivative projects. These should be considered experimental right now from the perspective of consumers of clara-rules, although it is possible that this namespace will be made part of the public API once its functionality has proven robust and reliable. The focus, however, is functionality needed to test the rules engine itself.

Internal utilities for testing clara-rules and derivative projects.  These should be considered experimental
right now from the perspective of consumers of clara-rules, although it is possible that this namespace 
will be made part of the public API once its functionality has proven robust and reliable.  The focus, however,
is functionality needed to test the rules engine itself.
raw docstring

assert-ex-dataclj/smacro

(assert-ex-data expected-ex-data form)
(assert-ex-data expected-ex-message expected-ex-data form)
source

def-rules-testclj/smacro

(def-rules-test name params & forms)

This macro allows creation of rules, queries, and sessions from arbitrary combinations of rules and queries in a setup map without the necessity of creating a namespace or defining a session using defsession in both Clojure and ClojureScript. The first argument is the name of the test, and the second argument is a map with entries :rules, :queries, and :sessions. For example usage see clara.test-testing-utils. Note that sessions currently can only contain rules and queries defined in the setup map; supporting other rule sources such as namespaces and defrule/defquery may be possible in the future.

Namespaces consuming this macro are expected to require clara.rules and either clojure.test or cljs.test. Unfortunately, at this time we can't add inline requires for these namespace with the macroexpanded code in ClojureScript; see https://anmonteiro.com/2016/10/clojurescript-require-outside-ns/ for some discussion on the subject. However, the test namespaces consuming this will in all likelihood have these dependencies anyway so this probably isn't a significant shortcoming of this macro.

This macro allows creation of rules, queries, and sessions from arbitrary combinations of rules
and queries in a setup map without the necessity of creating a namespace or defining a session
using defsession in both Clojure and ClojureScript.  The first argument is the name of the test, 
and the second argument is a map with entries :rules, :queries, and :sessions.  For example usage see
clara.test-testing-utils.  Note that sessions currently can only contain rules and queries defined
in the setup map; supporting other rule sources such as namespaces and defrule/defquery may be possible
in the future.

Namespaces consuming this macro are expected to require clara.rules and either clojure.test or cljs.test.
Unfortunately, at this time we can't add inline requires for these namespace with the macroexpanded code in
ClojureScript; see https://anmonteiro.com/2016/10/clojurescript-require-outside-ns/ for some discussion on the 
subject.  However, the test namespaces consuming this will in all likelihood have these dependencies anyway
so this probably isn't a significant shortcoming of this macro.
sourceraw docstring

ex-data-mapsclj

(ex-data-maps t)

Given a throwable/exception/error t, return all ex-data maps from the stack trace cause chain in the order they occur traversing the chain from this t through the rest of the call stack.

Given a throwable/exception/error `t`, return all `ex-data` maps from the stack trace cause chain in 
the order they occur traversing the chain from this `t` through the rest of the call stack.
sourceraw docstring

(ex-data-search e edata)
(ex-data-search e emsg edata)
source

execute-testsclj/s

(execute-tests func iterations)
source

get-all-ex-dataclj

(get-all-ex-data e)

Walk a Throwable chain and return a sequence of all data maps from any ExceptionInfo instances in that chain.

Walk a Throwable chain and return a sequence of all data maps
from any ExceptionInfo instances in that chain.
sourceraw docstring

join-filter-equalsclj/s

(join-filter-equals & args)

Intended to be a test function that is the same as equals, but is not visible to Clara as such and thus forces usage of join filters instead of hash joins

Intended to be a test function that is the same as equals, but is not visible to Clara as such
and thus forces usage of join filters instead of hash joins
sourceraw docstring

opts-fixtureclj

(opts-fixture f)
source

run-performance-testclj/s

(run-performance-test form)

Created as a rudimentary alternative to criterium, due to assumptions made during benchmarking. Specifically, that criterium attempts to reach a steady state of compiled and loaded classes. This fundamentally doesn't work when the metrics needed rely on compilation or evaluation.

Created as a rudimentary alternative to criterium, due to assumptions made during benchmarking. Specifically, that
criterium attempts to reach a steady state of compiled and loaded classes. This fundamentally doesn't work when the
metrics needed rely on compilation or evaluation.
sourceraw docstring

side-effect-holderclj/s

source

side-effect-holder-fixtureclj/s

(side-effect-holder-fixture t)

Fixture to reset the side effect holder to nil both before and after tests. This should be used as a :each fixture.

Fixture to reset the side effect holder to nil both before and after tests.
This should be used as a :each fixture.
sourceraw docstring

time-executionclj/s

(time-execution func)
source (clj)source (cljs)

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

× close