Tests

Unit and CLI tests

cargo test --offline --release -- --test-threads=1

CCF corpus

The CCF corpus tests need a clean source checkout of the pinned microsoft/CCF revision — you don’t need to build it.

export CANOLEAN_CCF_CORPUS=/path/to/CCF
cargo test --offline --release --test ccf_corpus -- --ignored --nocapture
cargo test --offline --release --test layout_rules -- --ignored --nocapture
  • ccf_corpus formats every file and asks Lean to parse the output, checking that the syntax matches the input and that formatting it again changes nothing.
  • layout_rules fuzz-tests the derived layout rules against Lean (well beyond the layouts the formatter itself emits) on both CCF and Lean’s own toolchain sources. On Lean’s sources, it also tests rules for syntax the formatter doesn’t lay out, starting from each file as written. Running across all of Lean’s sources takes about 15 minutes on a 10-core machine; set CANOLEAN_SOURCES_STRIDE=n to sample every n-th file.

Lean toolchain sources

To run only the Lean toolchain checks (core and Verso extension) without a CCF checkout:

cargo test --offline --release --test layout_rules -- lean_reads --ignored --nocapture
cargo test --offline --release --test layout_rules -- verso_extension_preserves_parse_on_lean_verso_sources --ignored --nocapture

These use the build-time Lean toolchain’s sources, or LEAN_SYSROOT if set.

CI

.github/workflows/ci.yml runs these suites on every pull request and push to main (sampling every fifth file of Lean’s sources) in about ten minutes. It also checks cargo fmt --check, Clippy with -D warnings -F unsafe_code, the declared MSRV, zero external Cargo dependencies, canolean --check on the repo’s Lean package, grammar/ freshness against lean grammar/Extract.lean, leanchecker + axiom-audit on Canolean, and the Charon/Aeneas extraction, kernel replay, and axiom gate via proofs/check.sh.

Contributing

See CONTRIBUTING.md for development setup, test commands, and proof verification instructions.