Borrowing it
Nothing to install: this file belongs to solanabr/solana-vault-standard. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/solanabr/solana-vault-standard/main/.claude/commands/test-rust.mdgit clone --depth 1 https://github.com/solanabr/solana-vault-standardWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/solanabr/solana-vault-standard/test-rust)<a href="https://agentmods.dev/commands/solanabr/solana-vault-standard/test-rust"><img src="https://agentmods.dev/badge/commands/solanabr/solana-vault-standard/test-rust.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00010 | $0.02358 |
| Opus 5 | $0.00005 | $0.01179 |
| Sonnet 5 | $0.00002 | $0.00472 |
| Haiku 4.5 | $0.00001 | $0.00236 |
Grade A, and why
test-rust scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
94% identical to test-rust — 4 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 404 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are running Rust tests. This command covers Solana program testing (Mollusk, LiteSVM, Surfpool, Trident) and backend service testing.
Related Skills
- testing.md - Testing strategy details
- security.md - Security testing checklist
- programs/anchor.md - Anchor test patterns
- programs/pinocchio.md - Pinocchio test patterns
Step 1: Identify Project Type
echo "🔍 Detecting project type..."
if [ -f "Anchor.toml" ]; then
echo "📦 Anchor project detected"
PROJECT_TYPE="anchor"
elif grep -q "pinocchio" Cargo.toml 2>/dev/null; then
echo "🎯 Pinocchio program detected"
PROJECT_TYPE="pinocchio"
elif grep -q "solana-program" Cargo.toml 2>/dev/null; then
echo "⚙️ Solana native program detected"
PROJECT_TYPE="solana"
elif grep -q "axum\|tokio" Cargo.toml 2>/dev/null; then
echo "🌐 Rust backend service detected"
PROJECT_TYPE="backend"
else
echo "🦀 Standard Rust project detected"
PROJECT_TYPE="standard"
fi
Solana Program Testing
Testing Pyramid
- Unit tests (fastest): Mollusk - individual instruction tests
- Integration tests (fast): LiteSVM - multi-instruction flows
- Realistic state tests: Surfpool - mainnet/devnet state locally
- Fuzz tests: Trident - edge case discovery
Mollusk Unit Tests
Fast, isolated tests for individual instructions:
echo "🐚 Running Mollusk unit tests..."
cargo test --lib -- --nocapture
#[cfg(test)]
mod tests {
use mollusk_svm::Mollusk;
use solana_sdk::{account::Account, pubkey::Pubkey, instruction::Instruction};
#[test]
fn test_initialize() {
let program_id = Pubkey::new_unique();
let mollusk = Mollusk::new(&program_id, "target/deploy/my_program.so");
// Setup accounts
let user = Pubkey::new_unique();
let accounts = vec![
(user, Account::new(1_000_000_000, 0, &program_id)),
];
// Create instruction
let instruction = Instruction {
program_id,
accounts: vec![],
data: vec![0], // Initialize discriminator
};
// Process and verify
let result = mollusk.process_instruction(&instruction, &accounts);
assert!(result.program_result.is_ok());
// Check CU usage
println!("CU consumed: {}", result.compute_units_consumed);
assert!(result.compute_units_consumed < 50_000);
}
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 404 lines · 10 tokens per session scan A cbb6b4fdecca
test-rust is a command published in the GitHub repository solanabr/solana-vault-standard (23 stars, last pushed 4mo ago), licensed MIT. It adds 10 tokens to every session and 2,358 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 94% identical to test-rust, differing in 4 lines, and is treated as a copy.
Other commands, from other repositories
rust-test
Rust TDD workflow with unit and property tests.
test-rust
Run Rust tests for Solana programs and backend services.
cargo-bench
Command "cargo-bench" from olorehq/olore, covering cargo-bench(1), name, synopsis, description and working directory of benchmarks.
cargo-test
Command "cargo-test" from olorehq/olore, covering cargo-test(1), name, synopsis, description and documentation tests.
check-production-ready
Verifies ccswarm's production quality criteria.
mutation-test
Uses cargo-mutants to run mutation tests and verify test quality.