Avoid the hassle of restructuring comments into functions. Testify turns selected comments into automatically evaluated scripts, while remaining as comments embedded within the code. Evaluate these comments directly from within a test, or in any other way preferred. Rename the (comment) to (test-comment) and evaluate with (eval-in-ns 'your-namespace). Testify will find the test-comment and evaluate its content for you. The test-comment is an empty macro ignoring its body, just like comment, that Testify recognizes. Testify can easily be told to evaluate content of any other top level form, while test-comment is a default. Testify use levels of isolation. While eval-in-ns evaluates expressions in its namespace, like when evaluating comments manually, its sibling eval-as-use evaluates from within a temporary namespace, preventing pollution. This is more suitable for repeatable tests. Testify reads source code, and keeps track of where it is. Code should be highlighted when a test assertion fails, even though the assertion is in a comment. Testify is not a testing framework, but rather a pun on: to witness, reveal comment, display it in the repl.
[org.clojars.vstein/testify "0.3.1"]
org.clojars.vstein/testify {:mvn/version "0.3.1"}
implementation("org.clojars.vstein:testify:0.3.1")
<dependency> <groupId>org.clojars.vstein</groupId> <artifactId>testify</artifactId> <version>0.3.1</version> </dependency>
Note: this artifact is a non-canonical fork. See the wiki for more details.
Want to display the latest version of your project on GitHub? Use the markdown code below!
If you want to include pre-releases and snapshots, use the following markdown code: