rust-tests

Enforce Rust test conventions across crates with _test.rs files and fixtures.

Updated Feb 6, 2026
One-click install
npx skills add https://github.com/JoernStoehler/msc-math --skill rust-tests-joernstoehler
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-tests
Source: https://github.com/JoernStoehler/msc-math/tree/main/.claude/skills/rust-tests
Command: npx skills add https://github.com/JoernStoehler/msc-math --skill rust-tests-joernstoehler

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about rust-tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I organize Rust tests across multiple crates for consistent structure?

Rust test organization is standardized by placing tests in single-concern files with the suffix _test.rs, aligning them with the module structure. This ensures tests are discoverable, well-documented, and maintain traceable propositions across crates.

What is the best way to test expensive Rust functions?

Testing expensive Rust functions requires splitting tests into input-output behavior and internal behavior categories. Use precomputed fixtures for repeatable results and separate slow tests from fast ones to maintain suite efficiency.

How does proptest fit into a standard Rust testing philosophy?

Proptest is integrated into a Rust testing philosophy as one of two excessive test classes, focusing on mathematical propositions and properties. The other class handles standard correctness checks to ensure rigorous coverage.

When do I need test fixtures for Rust crates?

Test fixtures for Rust crates are needed when validating properties and edge cases requires precomputed datasets. Maintaining these fixtures ensures repeatable results and consistent test execution across different test categories.

Can I apply test conventions during Rust code reviews?

Rust test conventions can be applied during code reviews to enforce structured test categories, fixture usage, and documentation standards. This guides test organization, philosophy, and documentation when editing or refactoring _test.rs files.