Queue behaving as a value. Assert % := _ to pop from it. Async, will time out after :timeout option, default to 1000 (ms).
Queue behaving as a value. Assert `% := _` to pop from it. Async, will time out after `:timeout` option, default to 1000 (ms).
Bound by drive-tap to the test's queue poll fn (fn [n cb]); park-tap calls it with n=1.
Bound by `drive-tap` to the test's queue poll fn `(fn [n cb])`; `park-tap` calls it with n=1.
Bound by drive-tap to a 1-arg fn re-entering the coroutine with a delivered value.
Bound by `drive-tap` to a 1-arg fn re-entering the coroutine with a delivered value.
Holds the value the queue delivered for the in-flight park-tap; read by unpark-tap.
Holds the value the queue delivered for the in-flight `park-tap`; read by `unpark-tap`.
(deftest name & body)When load-tests is false, deftest is ignored.
When *load-tests* is false, deftest is ignored.
(drive-tap poll-1 coroutine)Run an async-% test coroutine: start it, and each time the queue yields, re-enter
with that value bound, until the body completes (its tail calls RCF__done!).
poll-1 is the test's (fn [n cb]) queue poll.
Run an async-% test `coroutine`: start it, and each time the queue yields, re-enter with that value bound, until the body completes (its tail calls `RCF__done!`). `poll-1` is the test's `(fn [n cb])` queue poll.
(enabled?)True when RCF currently runs tests blocks (reads the dynamic *enabled*).
True when RCF currently runs `tests` blocks (reads the dynamic `*enabled*`).
(once f)Wrap f so it runs at most once. Fires cljs.test done exactly once at the end of
the coroutine (rcf#56), guarding against a double-fire from convergent branches.
Wrap `f` so it runs at most once. Fires cljs.test `done` exactly once at the end of the coroutine (rcf#56), guarding against a double-fire from convergent branches.
(park-tap)Suspend var (rcf#56): register a one-shot poll of the async queue, then suspend.
The poll's callback re-enters the coroutine via *resume*.
Suspend var (rcf#56): register a one-shot poll of the async queue, then suspend. The poll's callback re-enters the coroutine via `*resume*`.
(run-tests! ns-sym)Run ns-sym's rcf tests on the JVM; returns
{:ns ns-sym :pass N :fail [entry …]} where entry =
{:file :line :column :doc :test-var :expected :actual}.
Reloads the ns under a binding-scoped enable — the *enabled* root is never
touched, so nothing leaks into other sessions or hot reloads. The reporter
active at call time still prints as usual; the returned map is additive.
A tests block that binds its own reporter (with-reporter) bypasses the
capture and is not counted. Side effect: defs inside tests blocks
remount into the ns and persist.
JVM-only: an nREPL eval compiles the :clj arms of a .cljc — a namespace's
cljs tests are compiled and run by the cljs build (browser / karma), not here.
Run `ns-sym`'s rcf tests on the JVM; returns
`{:ns ns-sym :pass N :fail [entry …]}` where entry =
`{:file :line :column :doc :test-var :expected :actual}`.
Reloads the ns under a binding-scoped enable — the `*enabled*` root is never
touched, so nothing leaks into other sessions or hot reloads. The reporter
active at call time still prints as usual; the returned map is additive.
A `tests` block that binds its own reporter (`with-reporter`) bypasses the
capture and is not counted. Side effect: `def`s inside `tests` blocks
remount into the ns and persist.
JVM-only: an nREPL eval compiles the `:clj` arms of a .cljc — a namespace's
cljs tests are compiled and run by the cljs build (browser / karma), not here.Function to push value to async queue, e.g. (tap 42). RCF redefines this var in tests context. For REPL
convenience, defaults to println outside of tests context.
Function to push value to async queue, e.g. `(tap 42)`. RCF redefines this var in tests context. For REPL convenience, defaults to println outside of tests context.
(unpark-tap)Resume var (rcf#56): the value the queue delivered for the matching park-tap.
Resume var (rcf#56): the value the queue delivered for the matching `park-tap`.
(with dispose-fn & body)Resource cleanup helper, based on missionary's dependency-free Task protocol, see https://github.com/leonoel/task
Resource cleanup helper, based on missionary's dependency-free Task protocol, see https://github.com/leonoel/task
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |