O'Reilly logo

Clojure Applied by Alex Miller, Ben Vandgrift

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Example-Based Tests with clojure.test

Example-based testing is the process of exercising bits of code by passing known inputs (the examples) and checking that the outputs match expected values. Most Clojure programs are composed primarily of immutable data and pure functions, which are particularly amenable to example-based tests, because no messy mutable state leaks into or out of the code being tested. Example-based testing is most useful when working in the small, at the level of single functions or small groups of functions. This style of testing is most commonly exemplified by the xUnit libraries available in most languages.

clojure.test is a library included in the Clojure standard library that provides facilities comparable to JUnit or ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required