(test-case f)
Sets metadata on function f identifying it as a test case. A test case function may execute arbitrary code and may have side effects. It should throw an exception to indicate failure. Returning without throwing an exception indicates success.
Additional identifying metadata may be placed on the function, such as :ns-name and :doc.
Sets metadata on function f identifying it as a test case. A test case function may execute arbitrary code and may have side effects. It should throw an exception to indicate failure. Returning without throwing an exception indicates success. Additional identifying metadata may be placed on the function, such as :ns-name and :doc.
(test-case-result type' source)
(test-case-result type' source thrown)
Creates a test case result map with keys :pass?, :source, and :thrown.
pass? is true if the test case passed successfully, false otherwise.
source is the test case object that returned this result.
thrown is the exception (Throwable) thrown by a failing test case.
Creates a test case result map with keys :pass?, :source, and :thrown. pass? is true if the test case passed successfully, false otherwise. source is the test case object that returned this result. thrown is the exception (Throwable) thrown by a failing test case.
(test-case-result? x)
True if x is a test case result.
True if x is a test case result.
(try-test-case f)
Executes a test case function. Catches all Throwables. Returns a map with the following key-value pairs:
:source - the input function :pass? - true if the function ran without throwing :thrown - the Throwable instance if thrown
Executes a test case function. Catches all Throwables. Returns a map with the following key-value pairs: :source - the input function :pass? - true if the function ran without throwing :thrown - the Throwable instance if thrown
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close