Fiveam Test Framework – 1.2.3
Update: if anyone knows how to make Textile 2 not mess with my lisp code and get all confused, I’d be obliged.
I’ve been using the fiveam test framework for common lisp. It has the usual features you’d expect from an xUnit style test framework, but the programmer’s interface to it is far cry from
The Fixtures, instead of being classes, (an OO cluge in my opinion) are just “with” macros. My lisp skills are a bit clumsy, but this framework leaves me with elegant tests. I like it.is macro is cool. When the test fails, it can figure out whether to present the programmer with two non-matching values or just show that an expression was false.
(eval-when (:compile-toplevel :load-toplevel :execute)
(def-fixture temp-dir ()
(let ((tmpname (make-pathname :directory '(:relative "tmp"))))
(flet ((dumpfile (name contents)
(let ((target (merge-pathnames tmpname name)))
(ensure-directories-exist target)
(with-open-file (s target
:direction :output
:if-does-not-exist :create)
(write-sequence contents s)))))
(ensure-directories-exist tmpname)
(&body)
(kmrcl:delete-directory-and-files tmpname)))))
(test another-test ()
(with-fixture temp-dir ()
(... more "is" tests ...))))))))))