Expand description
The Forge test runner.
Structsยง
- Contract
Runner - A type that executes all tests of a contract
- Function
Runner ๐ - Executes a single test function, returning a
TestResult. - Invariant
Persisted ๐Failure - Holds data about a persisted invariant failure.
- Replay
Context ๐ - Borrowed context shared by primary-invariant and handler-side replay helpers.
Constantsยง
- LIBRARY_
DEPLOYER - When running tests, we deploy all external libraries present in the project. To avoid additional libraries affecting nonces of senders used in tests, we are using separate address to predeploy libraries.
Functionsยง
- base_
counterexamples_ ๐to_ txes - Converts a persisted counterexample to
BasicTxDetails, settingshow_solidityin place. - fuzzer_
with_ ๐cases - persisted_
call_ ๐sequence - Helper function to load failed call sequence from file. Ignores failure if generated with different invariant settings than the current ones.
- record_
handler_ ๐failure - Persists a handler-side assertion bug under
<failure_dir>/handlers/<site>.json, where<site>iskeccak256(reverter || selector). - record_
invariant_ ๐failure - Helper function to persist invariant failure.
- replay_
persisted_ ๐call_ sequence - Converts a persisted
BaseCounterExamplesequence intoBasicTxDetails(applyingctx.show_solidityin place) and replays it viacheck_sequence. - replay_
persisted_ ๐handler_ failures - Replays persisted handler-side assertion bugs. A file is kept only if the anchor still
asserts at the same
(reverter, selector)site; stale files (anchor no longer asserts, asserts at a different site, or earlier call asserts) are deleted in place. - test_
paths ๐ - Helper function to set test corpus dir and to compose persisted failure paths.
Type Aliasesยง
- Check
Sequence ๐Result - Mirrors
check_sequenceโs return:(success, replayed_entirely, optional_reason).