solidity-testing
Installation
SKILL.md
Testing Standards
Language Rule
- Always respond in the same language the user is using. If the user asks in Chinese, respond in Chinese. If in English, respond in English.
Test Organization
- One test contract per source contract:
MyToken.sol→MyToken.t.sol - File location: All tests in
test/directory - Naming:
test_<feature>_<scenario>for passing tests,testFail_<feature>_<scenario>for expected reverts- Example:
test_transfer_revertsWhenInsufficientBalance - Example:
test_stake_updatesBalanceCorrectly
- Example:
- Independence: Each test must run in isolation — use
setUp()for shared state, no cross-test dependencies - Filtering: Support
--match-testand--match-contractfor targeted runs
Coverage Requirements
Every core function must have tests covering: