rust-testing

star 127

Use when adding or modifying tests. Ensures behavior changes are covered with focused tests and fast feedback.

Jxck By Jxck schedule Updated 2/25/2026

name: rust-testing description: Use when adding or modifying tests. Ensures behavior changes are covered with focused tests and fast feedback.

rust-testing Skill

Use this skill when adding or modifying tests in this repository.

Goal

Ensure behavior changes are covered with focused tests and fast feedback loops.

Test Strategy

  1. Unit tests for pure logic and validation helpers.
  2. Integration-like checks for command-level behavior when practical.
  3. Regression tests for security-sensitive fixes.

What to Test

  • Config parsing/validation (src/config.rs)
  • DNS response routing/forwarding decisions (src/dns.rs)
  • Proxy routing/header/body constraints (src/proxy.rs)
  • Key/cert file handling constraints (src/ca.rs)

Rules

  • Keep test scopes tight (one behavior per test).
  • Name tests by behavior, not implementation details.
  • Prefer deterministic fixtures and fixed inputs.
  • Avoid network dependency in unit tests.

Commands

cargo test -q
cargo check --workspace
cargo run -p xtask -- fmt-check

Done Criteria

  • New behavior is covered.
  • Existing tests still pass.
  • Tests remain readable and maintainable.
Install via CLI
npx skills add https://github.com/Jxck/sptth --skill rust-testing
Repository Details
star Stars 127
call_split Forks 8
navigation Branch main
article Path SKILL.md
More from Creator