The is
macro is the core of the clojure.test
library. It returns the value of its body expression, printing an error message if the expression returns a falsey value.
(defn square [x]
(+ x x))
(require '[clojure.test :as t])
(t/is (= 0 (square 0)))
;;=> true
(t/is (= 1 (square 1)))
;;
;; FAIL in () (foo.clj:1)
;; expected: (= 1 (square 1))
;; actual: (not (= 1 2))
;;=> false