RCT turns rich comment forms into tests.
RCT turns rich comment forms into tests.
(capture-clojure-test-out & body)
Capture any string output fom clojure.test while invoking body
, and
isolate test state.
Capture any string output fom clojure.test while invoking `body`, and isolate test state.
(context-strings test-sexpr-zloc)
A series of string comments preceding the test sexpr.
A series of string comments preceding the test sexpr.
(expectation-data test-sexpr-zloc)
Parse a string representing the expectation for a test expression and an
expression type, returning a vector of [type str]
(or nil if none).
The expected result is designated by a =>-prefixed comment, either directly after or on a line following the test expression.
For example:
(+ 1 1) ;=> 2
(+ 1 1) ;;=> 2
(+ 1 1) ;; => 2
Parse a string representing the expectation for a test expression and an expression type, returning a vector of `[type str]` (or nil if none). The expected result is designated by a =>-prefixed comment, either directly after or on a line following the test expression. For example: (+ 1 1) ;=> 2 (+ 1 1) ;;=> 2 (+ 1 1) ;; => 2
(iterate1 f x)
Like clojure.core/iterate
, but stops at the first nil
element.
Like `clojure.core/iterate`, but stops at the first `nil` element.
(pairs)
Transducer from [a b c ... z] => [[a b] [b c] ... [z nil]].
Transducer from [a b c ... z] => [[a b] [b c] ... [z nil]].
(rct-data-seq rct-zloc)
Take an rct zloc and return a series of maps with information about tests to run.
Take an rct zloc and return a series of maps with information about tests to run.
(rct-zlocs source-file-root-zloc)
Given the root zloc for a source file, return a series of rct zlocs.
Given the root zloc for a source file, return a series of rct zlocs.
(rct? zloc)
Is the node at the zloc
a ^:rct/test (comment ...) block?
Is the node at the `zloc` a ^:rct/test (comment ...) block?
(require-file-for-ns ns)
Given a Namespace, attempt to find a corresponding source file, or throw an exception if this isn't possible.
Given a Namespace, attempt to find a corresponding source file, or throw an exception if this isn't possible.
(result-comment? s)
A string like ";=> _" or ";=>> _" or ";; => _"
A string like ";=> _" or ";=>> _" or ";; => _"
(rsequence xform coll)
Like (reverse (sequence xform coll))
.
Like `(reverse (sequence xform coll))`.
(run-file-tests! file ns)
Take a file path and the namespace it corresponds to, and run tests.
Take a file path and the namespace it corresponds to, and run tests.
(run-ns-tests! ns)
Take a namespace or namespace symbol, attempt to find the corresponding source file, and run tests in the namespace.
Take a namespace or namespace symbol, attempt to find the corresponding source file, and run tests in the namespace.
(run-tests* zloc)
Take a rewrite-clj
zipper pointed at the root of a file and run all rich
comment tests.
The zipper must have be configured with {:track-position? true}.
ns and file should be bound before calling this.
Take a `rewrite-clj` zipper pointed at the root of a file and run all rich comment tests. The zipper must have be configured with {:track-position? true}. *ns* and *file* should be bound before calling this.
(test-sexpr-zlocs rct-zloc)
All sexpr-able nodes inside a rct form.
All sexpr-able nodes inside a rct form.
(with-clojure-test-reporting & body)
Run body
with clojure.test reporting, unless it is already active.
Run `body` with clojure.test reporting, unless it is already active.
(with-printlns & body)
Rebind println
during the execution of body to print as normal, PLUS
save each line of output, and return a vector of printed lines.
Rebind `println` during the execution of body to print as normal, PLUS save each line of output, and return a vector of printed lines.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close