What problem does it solve?
Testing conventions for Rust code in crates/. Load when writing, editing, or reviewing tests with the suffix _test.rs files or test fixtures. Covers testing philosophy, expensive function testing patterns, test organization, fixtures, and documentation requirements.
Core Features & Use Cases
- Testing philosophy: Two classes of tests, both applied excessively. One focuses on mathematical propositions or properties, the other on standard correctness checks. The organization guidelines encourage a consistent structure and rigorous coverage.
- Testing Expensive Functions: For expensive functions, split tests into input-output behavior and internal behavior categories, using fixtures for repeatable results and separating slow tests from fast ones.
- Test Organization: Use single-concern test files; align tests with module structure; ensure tests are discoverable and well-documented; maintain traceable documentation of the tested propositions.
- Fixtures: Maintain precomputed fixtures or datasets to validate properties and edge cases.
Quick Start
Follow these conventions when writing or reviewing Rust tests in crates, placing tests in files with the suffix _test.rs and organizing fixtures per the guidelines.