Guidelines for writing Rust tests.
Guidelines for writing new tests for Rust code.
insta whenever you are testing output that is difficult to predict or compare.proptest to add property-based tests for key invariants.pub) items under the crate's tests directory. Two layouts are
in use and both are fine — match whichever the crate already has:
tests/integration/ — one test crate with its own main.rs and a module per
area (trie_rs, geo, query_eval, …). Prefer this for a new crate: it compiles as
a single unit instead of one binary per file.tests/*.rs file (varint,
fork_gc, rlookup, …).#[cfg(test)] module. Integration tests cannot reach pub(crate) or private items,
so this is the only option for them — but prefer exercising the behavior through the
public API where you can, per guideline 2 above.Check out CONTRIBUTING.md for instructions on how to deal with undefined C symbols in Rust tests.
npx skills add RediSearch/rust-tests-guidelines下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer