Rust Skills Tests
Overview
This directory contains test scenarios for validating rust-skills functionality.
Directory Structure
tests/
├── README.md
├── scenarios/ # Test scenarios by category
│ ├── ownership.md # m01-m04 ownership/resource tests
│ ├── layer2-skills.md # m05, m09-m15 design skills
│ ├── domain-skills.md # Layer 3 domain skills
│ ├── unsafe.md # unsafe-checker tests
│ ├── routing.md # rust-router tests
│ └── agents.md # Agent integration tests
│
├── pressure-scenarios/ # Edge case tests
│ ├── m01-ownership/
│ ├── m06-error-handling/
│ └── m07-concurrency/
│
└── validation/ # Validation scripts
└── validate-skills.sh
Quick Test Reference
See test-triggers.md in project root for complete trigger test checklist.
Running Tests
Manual Testing
Use the test scenarios as prompts:
# Layer 1: Language Mechanics
claude -p "E0382 错误怎么解决" # m01-ownership
claude -p "E0499 multiple mutable borrows" # m03-mutability
claude -p "newtype pattern" # m05-type-driven
claude -p "Send Sync trait" # m07-concurrency
# Layer 2: Design Choices
claude -p "DDD in Rust" # m09-domain
claude -p "benchmark 怎么写" # m10-performance
claude -p "RAII pattern" # m12-lifecycle
claude -p "常见 Rust 错误" # m15-anti-pattern
# Layer 3: Domain Constraints
claude -p "axum web server" # domain-web
claude -p "decimal 精度计算" # domain-fintech
claude -p "no_std embedded" # domain-embedded
# Core Skills
claude -p "unsafe 代码怎么写" # unsafe-checker
claude -p "tokio 最新版本" # rust-learner
Validation Script
./tests/validation/validate-skills.sh
Test Categories
1. Layer 1 - Language Mechanics (m01-m07)
- Ownership, borrowing, lifetimes
- Resource management
- Mutability
- Zero-cost abstraction
- Type-driven design
- Error handling
- Concurrency
2. Layer 2 - Design Choices (m09-m15)
- Domain modeling
- Performance optimization
- Ecosystem integration
- Resource lifecycle
- Domain error patterns
- Mental models
- Anti-patterns
3. Layer 3 - Domain Constraints
- domain-fintech
- domain-web
- domain-cli
- domain-embedded
- domain-cloud-native
- domain-iot
- domain-ml
4. Core Skills
- rust-router
- rust-learner
- coding-guidelines
- unsafe-checker
5. Agent Integration
- crate-researcher
- rust-changelog
- docs-researcher
- clippy-researcher
Coverage Summary
| Category | Skills | Tested |
|---|---|---|
| Layer 1 | 7 | 7/7 |
| Layer 2 | 7 | 7/7 |
| Layer 3 | 7 | 7/7 |
| Core | 4 | 4/4 |
| Total | 25 | 25/25 |
Adding New Tests
- Create scenario file in
tests/scenarios/ - Include:
- Test prompt
- Expected skill trigger
- Expected response elements
- Update
test-triggers.mdin project root - Update validation script if needed
你可能感兴趣的文章
Agent Integration Test Scenarios
Ownership (m01) Test Scenarios
Pressure Scenario: When to Use unwrap()