solhint

foundry-test-functions

Category Badge Default Severity Badge warn

Description

Enforce naming convention on functions for Foundry test cases

Options

This rule accepts an array of options:

Index Description Default Value
0 Rule severity. Must be one of “error”, “warn”, “off”. warn

Example Config

{
  "rules": {
    "foundry-test-functions": ["warn",["setUp"]]
  }
}

Notes

Examples

👍 Examples of correct code for this rule

Foundry test case with correct Function declaration

function test_NumberIs42() public {}

Foundry test case with correct Function declaration

function testFail_Subtract43() public {}

Foundry test case with correct Function declaration

function testFuzz_FuzzyTest() public {}

👎 Examples of incorrect code for this rule

Foundry test case with incorrect Function declaration

function numberIs42() public {}

Version

This rule was introduced in Solhint 3.6.1

Resources