Testing¶
cl-prolog's regression suite is the cl-prolog/test ASDF system. It depends on
cl-weave and covers isolated table
cases, per-query cases, fixtures, and generated relational properties.
Run the suite¶
The Nix runner is self-contained and is the authoritative path on supported
systems (x86_64-linux, aarch64-darwin):
Pass any cl-weave CLI options after --; for example, to produce a JSON result:
The full verification suite — including packaging, examples, the docs build, and the structural parse gate — is:
Unsupported platforms
On platforms outside the three supported systems (e.g. Intel Mac,
Windows), ensure cl-weave is discoverable through ASDF and run the
suite directly:
Then rely on CI for the Nix nix flake check path.
What nix flake check runs¶
checks.default— the cl-weave regression suite, run throughrun-tests.lispunder a plain SBCL with the compiled-in default dynamic space.checks.paredit-lint— a structural parse gate over every tracked.lisp/.asdfile, failing if any is not a balanced S-expression document.checks.examples— loads every shipped example through ASDF (Examples).checks.docs— builds the MkDocs site with--strictand fails if it does not produce a validindex.html.checks.formatting— checks every Nix file againstnixfmt, via treefmt.nix fmtfixes what it reports.checks.package— buildspackages.default, so the package README.md advertises (nix run github:nerima-lisp/cl-prolog) is actually realised, not merely evaluated.checks.app-test— runsapps.test, the cl-weave CLI wrapper (a distinct code path fromchecks.default: it sets a 4096 MB dynamic space).
Query test helpers¶
Load the cl-prolog/weave ASDF system to use the public query test helpers:
deftest-queries creates an independent cl-weave case and a fresh rulebase for
every query. A leading case label is optional; without one, the printed query is
used.
(cl-prolog/weave:deftest-queries family-queries ((make-family-rulebase))
("keeps proof order" (parent alice ?child) :ordered
(((?child . bob)) ((?child . carol))))
((parent alice ?child) :set
(((?child . carol)) ((?child . bob))))
((parent alice ?child) :first ((?child . bob)))
((parent alice bob) :succeeds)
((parent bob alice) :fails)
((parent alice bob) :signals cl-prolog:invalid-max-depth-error
:max-depth :invalid))
Assertion kinds:
:ordered— compares the full solution sequence, order included.:set— ignores only the order of complete solutions; it still compares the structure within each solution withequal.:first— compares the first solution's bindings.:succeeds/:fails— assert provability without inspecting bindings.:signals— asserts a condition is raised, optionally of a given type.
Query options (such as :max-depth) follow the expected value or assertion
kind.
Use assert-query inside an existing cl-weave case when a table is not needed:
(cl-weave:it "finds Alice's first child"
(cl-prolog/weave:assert-query (make-family-rulebase)
(parent alice ?child) :first ((?child . bob))))
See also¶
- Development — the development environment and workflow.
- Benchmarks — the diagnostic performance harness.
- Release Checklist — the evidence bar for shipping.