rust-testing

rust-testing is a skill for Claude Code, Codex from bl1nk-bot/bl1nk-agents-manager. It costs 31 tokens per session (3,092 once invoked), scanned A, original, MIT.

A guide to testing Rust programs, including unit, integration, asynchronous, property-based, mock, benchmark, and coverage testing. TDD, or test-driven development, means writing a failing test before the code and then improving the code while tests stay passing.

In plain words
What is it for?
Use it when adding tests, coverage, benchmarks, input validation, mocks, or a test-first workflow to a Rust project.
Why use it?
It gives a repeatable way to check Rust code and isolate dependencies, reducing the chance that changes break existing behavior.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when adding tests, coverage, benchmarks, input validation, mocks, or a test-first workflow to a Rust project.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bl1nk-bot/bl1nk-agents-manager/rust-testing
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add bl1nk-bot/bl1nk-agents-manager --skill rust-testing
Clone the repo
git clone --depth 1 https://github.com/bl1nk-bot/bl1nk-agents-manager

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rust-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/bl1nk-bot/bl1nk-agents-manager/rust-testing/github.svg)](https://agentmods.dev/skills/bl1nk-bot/bl1nk-agents-manager/rust-testing)
Your own site
<a href="https://agentmods.dev/skills/bl1nk-bot/bl1nk-agents-manager/rust-testing"><img src="https://agentmods.dev/badge/skills/bl1nk-bot/bl1nk-agents-manager/rust-testing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rust-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/bl1nk-bot/bl1nk-agents-manager/rust-testing"><img src="https://agentmods.dev/badge/skills/bl1nk-bot/bl1nk-agents-manager/rust-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,092 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00031 $0.03092
Opus 5 $0.00015 $0.01546
Sonnet 5 $0.00006 $0.00618
Haiku 4.5 $0.00003 $0.00309

Measured 9d ago against content hash 049a5f6fca56, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

rust-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/rust-testing/SKILL.md · 471 lines

How it starts

The opening of the file, as written. The whole thing — 471 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

// RED: Write test first, use todo!() as placeholder
pub fn add(a: i32, b: i32) -> i32 { todo!() }

#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn test_add() { assert_eq!(add(2, 3), 5); }
}
// cargo test → panics at 'not yet implemented'
// GREEN: Replace todo!() with minimal implementation
pub fn add(a: i32, b: i32) -> i32 { a + b }
// cargo test → PASS, then REFACTOR while keeping tests green
```text
## Unit Tests

### Module-Level Test Organization
```rust
// src/user.rs
pub struct User {
    pub name: String,
    pub email: String,
}

impl User {
    pub fn new(name: impl Into<String>, email: impl Into<String>) -> Result<Self, String> {
        let email = email.into();
        if !email.contains('@') {
            return Err(format!("invalid email: {email}"));
        }
        Ok(Self { name: name.into(), email })
    }

    pub fn display_name(&self) -> &str {
        &self.name
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn creates_user_with_valid_email() {
        let user = User::new("Alice", "[email protected]").unwrap();
        assert_eq!(user.display_name(), "Alice");
        assert_eq!(user.email, "[email protected]");
    }

    #[test]
    fn rejects_invalid_email() {
        let result = User::new("Bob", "not-an-email");
        assert!(result.is_err());
        assert!(result.unwrap_err().contains("invalid email"));
    }
}
```text

Read the full file on GitHub · 471 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 471 lines · 31 tokens per session scan A 049a5f6fca56

Subscribe to this mod's changes

rust-testing is a skill published in the GitHub repository bl1nk-bot/bl1nk-agents-manager (8 stars, last pushed 1mo ago), licensed MIT. It adds 31 tokens to every session and 3,092 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.