rust-testing
/rust-testing
Patterns for Rust testing in Axone CosmWasm contracts. Use when adding unit tests, integration tests, data-driven cases, or coverage-oriented test scenarios.
- Author
- axone-protocol ↗
- Repository
- contracts ↗
- Licence
- BSD-3-Clause
- Last repository change
- 27.10.2026
Assessment and security
- Files in this package
- 3
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.
BSD-3-Clause, otwarta.
What it does and when to use it
Patterns for Rust testing in Axone CosmWasm contracts. Use when adding unit tests, integration tests, data-driven cases, or coverage-oriented test scenarios.
Original author description
Patterns for Rust testing in Axone CosmWasm contracts. Use when adding unit tests, integration tests, data-driven cases, or coverage-oriented test scenarios.
How it works
- Coverage Targets
- Minimum Cases to Cover
- Running Tests
- Viewing Coverage
- Test Design Rules
- References
SKILL.md preview
--- name: rust-testing description: Patterns for Rust testing in Axone CosmWasm contracts. Use when adding unit tests, integration tests, data-driven cases, or coverage-oriented test scenarios. license: BSD-3-Clause metadata: author: axone.xyz version: "1.0" --- # Rust Testing ## Coverage Targets | Component | Target | | -------------------- | ------ | | **Handlers** | 100% | | **State operations** | 100% | | **Error paths** | 90%+ | | **Message parsing** | 80%+ | | **Overall** | 90%+ | ## Minimum Cases to Cover - For handlers: cover the happy path, parameter variations, error paths, and resulting state changes. - For queries: cover empty state, populated state, pagination behavior, and non-existent items. - For state transitions: cover initial state, updates after execute, and persistence across operations. ## Running Tests ```bash # Run all unit tests cargo make test-unit # Run all tests (includes integration) cargo make test # Run tests with coverage cargo make test-coverage # Run specific test cargo test test_name -- --nocapture ``` Coverage output is written to `lcov.info`. ## Viewing Coverage ```bash # Generate HTML report (requires lcov) genhtml lcov.info --output-directory coverage/ # Or use cargo-llvm-cov directly cargo llvm-cov --html --open ``` ## Test Design Rules 1. Isolate tests. Each test should set up its own environment. 2. Test contract behavior, not framework internals. 3. Assert exact errors when possible. 4. Cover edge cases such as zero values, empty strings, and upper bounds. 5. Prefer descriptive test names without a `test_` prefix. 6. Use tuple-driven cases for simple matrices and structs only when the case shape needs named fields. ## References - For cw-orch integration harness patterns and common integration scenarios, read [integration-patterns](./references/integration-patterns.md). - For naming and data-driven test examples, read [test-style](./references/test-style.md).
Files in this package (3)
- SKILL.md 2 KB
- references/integration-patterns.md 3 KB
- references/test-style.md 2 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · axone-protocol/contracts | 100 | BSD-3-Clause |
| xobotyi/cc-foundry | 100 | MIT |
| affaan-m/ECC | 100 | MIT |
| claude-dev-suite/claude-dev-suite | 100 | MIT |
| SHRIJANAGAIN/Nemo-Cli | 100 | Apache-2.0 |
| AutumnsGrove/Lattice | 100 | AGPL-3.0 |
| full-stack-skills/rust-skills | 100 | Apache-2.0 |
| rewrite-rs/skills | 95 | BSD-3-Clause |
| cybercoretech/cybercore-agent-skills | 90 | MIT |
Database snapshot: 13.11.2026 · package version a548818015a7 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100cosmwasm-contract
Axone contract structure and Abstract SDK patterns. Use when scaffolding or refactoring contracts, deciding layer boundaries, wiring AppContract entrypoints, or adding module metadata and replies. - 100rust-contract-domain-modeling
Domain-driven modeling patterns for Axone contracts. Use when introducing domain concepts, encoding invariants, or deciding boundaries between domain, handlers, services, gateways, queries, and state. - 100testing
Apply comprehensive testing best practices including unit, integration, and e2e tests. Use when writing tests, reviewing test coverage, designing testable code, or setting up test infrastructure. - 100testing-patterns
Testing patterns for unit, integration, and end-to-end tests. Use when writing tests, setting up test fixtures, or validating RLS enforcement. Routes to existing test conventions. - 95test-specialist
Test-writing patterns for JS/TS, Python, Go, and Rust (unit, integration, E2E, visual regression). Use only when the user explicitly asks for tests or test coverage; for debugging without a test request, use debug-systematic. - 100designing-tests
Designs and implements testing strategies for any codebase. Use when adding tests, improving coverage, setting up testing infrastructure, debugging test failures, or when asked about unit tests, integration tests, or E2E testing.