1 Home
dxtr edited this page 2026-10-18 12:07:40 +02:00

assay

assay is a zero-dependency test framework for SBCL, with the ergonomics of Go's testing, Rust's harness, Tasty and JUnit/AssertJ, plus a Mockito-style mocking layer. It replaces Parachute.

It is two source files in one ASDF system. You can vendor assay.lisp alone into a project and get everything except mocks.

(defpackage #:parser/test (:use #:cl #:assay #:parser))
(in-package #:parser/test)

(deftest parse-numbers
  "Decimal integers, with and without sign."
  (is (= 42 (parse "42")))
  (is (= -1 (parse "-1")))
  (signals parse-error (parse "4x2")))
CL-USER> (assay:run :parser/test)

parser/test  ✓  1 passed   (0.3 ms)
ok: 1 test   (0.3 ms)
#<SUMMARY 1 tests, all passed>

One macro, is, does the work AssertJ needs a fluent API for: it reads its own source form, evaluates each operand once, and on failure shows every non-literal operand with its value plus a one-line explanation.

CL-USER> (is (= -1 (parse "-1")))   ; parse returns 1 here
✗ (is (= -1 (parse "-1")))
      (parse "-1") ⇒ 1
      differ by 2

Why assay

  • No dependencies. SBCL and its bundled contribs, nothing else. A test framework belongs at the bottom of the dependency graph.
  • One assertion. is sees your source, so (is (= a b)) shows a, b and how they differ — no assert-equal, no fluent chains.
  • Explanations you can extend. explain is a generic function; teach it your own predicates and every failure gets a helpful line.
  • Record and continue. Like Go's t.Error and JUnit's assertAll; only must stops the test.
  • Parallel when you ask. One worker per core, opt out per test with :serial t; the report is identical to a serial run's.
  • Mocks that read like tests. with-mocks swaps global functions for a dynamic extent; verification is is with called-p, call-count and calls.

Installing

assay is plain ASDF. Put the checkout where ASDF can find it:

(asdf:load-system "assay")

Requires SBCL 2.4 or later. There is no portability layer; assay uses SBCL's threads, timeouts, backtraces and alien calls directly.

The manual

License

MIT. Copyright © 2026 dxtr.