rust-unit-tests

Write and refine Rust unit tests for the Warp codebase.

Updated Apr 30, 2026
One-click install
npx skills add https://github.com/lalaABC/waprcn --skill rust-unit-tests-lalaabc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-unit-tests
Source: https://github.com/lalaABC/waprcn/tree/main/.agents/skills/rust-unit-tests
Command: npx skills add https://github.com/lalaABC/waprcn --skill rust-unit-tests-lalaabc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Improve Rust unit test coverage within the Warp codebase by writing and refining tests.

Core Features & Use Cases

  • Focused crate- and module-level testing to validate single behavior per case.
  • Clear conventions for test module inclusion, naming, and test attribute usage.
  • Real-world scenario: adding tests for a new function and running cargo test to confirm behavior.

Quick Start

Add a focused unit test for the target function and run cargo test to verify behavior.

Frequently Asked Questions about rust-unit-tests

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

FAQPage Schema
How do I write Rust unit tests for the Warp codebase?

To write Rust unit tests for the Warp codebase, add focused tests for single-function behavior using #[test] or #[tokio::test] attributes. You need to organize tests in a separate module file like ${filename}_tests.rs and include the test module declaration at the end of your source file.

What is the correct file naming convention for organizing Rust unit tests?

The correct file naming convention for Rust unit tests involves placing tests in a dedicated file named ${filename}_tests.rs or mod_test.rs. You must then declare this test module at the end of your source file to ensure proper compilation and test discovery.

Does this approach to Rust unit testing support async functions?

Yes, this approach to Rust unit testing supports async functions by using the #[tokio::test] attribute. This allows you to validate asynchronous behavior and deterministic test harnesses within the Warp codebase.

How do I test expected failures and edge cases in Rust?

To test expected failures and edge cases in Rust, use the #[should_panic] attribute alongside standard #[test] functions. This helps validate single behavior per case and ensures your function handles error conditions correctly.

Can I use cargo test to verify new function behavior in Rust?

Yes, you can use cargo test to verify new function behavior in Rust. After adding a focused unit test for the target function, running cargo test confirms the behavior and validates that your crate-level and module-level tests pass deterministically.

What are the limitations of crate-level Rust unit tests?

The limitation of crate-level Rust unit tests is that they focus strictly on single-function behavior and deterministic test harnesses. They are not designed for integration testing across multiple modules or non-deterministic external dependencies.