rust-unit-tests

Enforce Rust unit test conventions for Warp crates with modular test files.

37|1|Updated Apr 28, 2026
One-click install
npx skills add https://github.com/terzigolu/warp-lite --skill rust-unit-tests-terzigolu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-unit-tests
Source: https://github.com/terzigolu/warp-lite/tree/main/.agents/skills/rust-unit-tests
Command: npx skills add https://github.com/terzigolu/warp-lite --skill rust-unit-tests-terzigolu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Write, improve, and run Rust unit tests in the Warp codebase to ensure correctness and prevent regressions.

Core Features & Use Cases

  • Crate-level unit tests placed in files named ${filename}_tests.rs or mod_test.rs, included at the end of the corresponding source file.
  • Guidelines for descriptive test names, using assert macros for clearer diffs, and minimizing global state to improve testability.
  • Async test guidance using tokio-compatible tests and lightweight patterns to verify behavior across Warp crates.

Quick Start

Create or update a unit test module alongside your Rust source, then run cargo nextest to execute the tests.

Frequently Asked Questions about rust-unit-tests

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

FAQPage Schema
How do I structure Rust unit tests in a Warp crate?

Rust unit tests in Warp should be placed in files named ${filename}_tests.rs or mod_test.rs, included at the end of the corresponding source file. This modular test structure ensures reliable test coverage across Warp components.

What's the best way to run Rust unit tests for Warp components?

Run Rust unit tests for Warp components using cargo nextest. After creating or updating your unit test module alongside the Rust source, cargo nextest executes the tests to verify behavior and prevent regressions.

How do I write async unit tests in Warp crates?

Write async unit tests in Warp crates using tokio-compatible test attributes and lightweight patterns. This approach provides guidance on async tests and test isolation to correctly verify asynchronous behavior across Warp components.

Does the Warp unit testing approach require specific naming conventions?

Yes, the Warp unit testing approach requires descriptive test names and specific file naming conventions like ${filename}_tests.rs. It also enforces using assert macros for clearer diffs and minimizing global state to improve testability.

Why should I minimize global state in Rust unit tests?

Minimizing global state in Rust unit tests improves testability and test isolation. The Warp testing conventions enforce this practice alongside using assert macros for clearer diffs and descriptive naming to ensure reliable test coverage.

Can I use cargo nextest to test individual Warp crates?

Yes, you can use cargo nextest to test individual Warp crates. The approach applies to crate-level tests, enforcing conventions for test file naming, module inclusion, and test attributes across Warp components to prevent regressions.