Some SAT solvers in Rust
sat docs testing.md
883 B 15 lines
Markdown

Testing #

Tests live in the #[cfg(test)] modules at the bottom of src/lib.rs (core types and parser), src/dpll.rs (DPLL solver), and src/cdcl.rs (CDCL solver). They cover indexing, unit propagation, empty clauses, tautologies, conflicts that require backtracking, clause learning, decision levels, solver reuse, and DIMACS output. Both solvers have a deterministic randomized test that compares them against a brute-force oracle over 500 small formulas. Keep those cross-checks when changing solver logic; they are the main guard against soundness/completeness regressions.

tests/cnf_cli.rs contains an integration test that runs the compiled binary with every DIMACS .cnf fixture in tests/fixtures/ and compares stdout against the adjacent <name>.cnf.expected file. Add new fixtures as a pair rather than embedding CNF files or expected output in the test source.