ClojureDocs

Nav

Namespaces

Clojure/Conj 2026 — Charlotte, NC — Sept 30 - Oct 2 Learn More & Get Tickets →

is

clojure.test

Available since 1.1 (source)
  • (is form)
  • (is form msg)
Generic assertion macro.  'form' is any predicate test.
'msg' is an optional message to attach to the assertion.

Example: (is (= 4 (+ 2 2)) "Two plus two should be 4")
 Special forms:
 (is (thrown? c body)) checks that an instance of c is thrown from
body, fails if not; then returns the thing thrown.
 (is (thrown-with-msg? c re body)) checks that an instance of c is
thrown AND that the message on the exception matches (with
re-find) the regular expression re.