Agent skill · Testing & QA

rust-testing

Rust testing patterns including unit tests, integration tests, async testing, property-based testing, mocking, and coverage. Follows TDD methodology.

mturacgithub.com/mturacGitHub ↗
codexcopilotcursorMIT
Install
npx skills add mturac/everything-openai-codex --skill rust-testing --agent codex

Same command for any agent — swap --agent for claude-code, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 11 KB
Bundled scripts: none
Path: skills/rust-testing/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 84
Language: JavaScript

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Rust Testing Patterns Comprehensive Rust testing patterns for writing reliable, maintainable tests following TDD methodology. ## When to Use - Writing new Rust functions, methods, or traits - Adding test coverage to existing code - Creating benchmarks for performance-critical code - Implementing property-based tests for input validation - Following TDD workflow in Rust projects ## How It Works 1. **Identify target code** — Find the function, trait, or module to test 2. **Write a test** — Use `#[test]` in a `#[cfg(test)]` module, rstest for parameterized tests, or proptest for property-based tests 3. **Mock dependencies** — Use mockall to isolate the unit under test 4. **Run tests (RED)** — Verify the test fails with the expected error 5. **Implement (GREEN)** — Write minimal code to pass 6. **Refactor** — Improve while keeping tests green 7. **Check coverage** — Use cargo-llvm-cov, target 80%+ ## TDD Workflow for Rust ### The RED-GREEN-REFACTOR Cycle ``` RED → Write a failing test first GREEN → Write minimal code to pass the test REFACTOR → Improve code while keeping tests green REPEAT → Continue with next requirement ``` ### Step-by-Step TDD in Rust ```rust // RED: Write test fi

What's inside
Steps it walks through
  1. When to Use
  2. How It Works
  3. TDD Workflow for Rust
  4. The RED-GREEN-REFACTOR Cycle
  5. Step-by-Step TDD in Rust
  6. Unit Tests
  7. Module-Level Test Organization
  8. Assertion Macros
  9. Error and Panic Testing
  10. Testing Result Returns
  11. Testing Panics
  12. Integration Tests
  13. File Structure
  14. Writing Integration Tests
Commands it runs
cargo llvm-cov                    # Summary
cargo llvm-cov --html             # HTML report
cargo llvm-cov --lcov > lcov.info # LCOV format for CI
cargo llvm-cov --fail-under-lines 80  # Fail if below threshold
cargo test                        # Run all tests
cargo test -- --nocapture         # Show println output
cargo test test_name              # Run tests matching pattern
cargo test --lib                  # Unit tests only
cargo test --test api_test        # Integration tests only
cargo test --doc                  # Doc tests only
More from everything-openai-codex
All skills →
About this skill
What does the rust-testing skill do?

Rust testing patterns including unit tests, integration tests, async testing, property-based testing, mocking, and coverage. Follows TDD methodology.

How do I install it?

Run `npx skills add mturac/everything-openai-codex --skill rust-testing --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From mturac/everything-openai-codex, a repository with 84 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going