liveBook · Manning

Is

As explained in Clojure: The Essential Reference

is is a clojure.test macro that evaluates an assertion expression and reports a structured test result.

`is` is a `clojure.test` macro for evaluating an assertion expression and reporting a readable result. It verifies truthiness, accepts an optional descriptive message, and exposes expected and actual values when an assertion fails. section 22.9

Readable assertion failure

```clojure (deftest sqrt-test (is (= 2 (sqrt 4)) "Expecting 2")) ``` A failing test reports the message, expected expression, and actual value—for example, a computed `2.000000000000002` instead of exact `2`. section 22.9

How Clojure: The Essential Reference covers it

How deep it goes
Defines truthy assertion behavior, optional messages, and expected-versus-actual reporting, but defers broader test-suite design.
Examples
Uses Newton-method square-root tests, grouped corner cases, thrown exceptions, and a custom roughly assertion.
What it assumes
Assumes basic Clojure expressions and testing context while demonstrating assertion syntax from simple examples.
What you can do after
Apply it via clojure.test to write assertions with actionable failure diagnostics.
How it connects
Connects assertions with clojure.test, deftest, testing, are, and test-var.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Clojure: The Essential Reference. The section links point to the parts of the book it draws on.