Forge Standard Library is a collection of helpful contracts for use with forge and foundry. It leverages forge's cheatcodes to make writing tests easier and faster, while improving the UX of cheatcodes. For more in-depth usage examples checkout the tests.
In the Foundry Book in Best Practices section there is a recommended way of naming tests, but the tests in this repo do not conform to this best practice. This is already issued in #273 .
I am open to rename those tests myself, but I just wanted to ask for some guidance before I make the changes.
In the test/StdChains.t.sol there is a test that looks like this ->
function test_ChainNoDefault() public {
// We deploy a mock to properly test the revert.
StdChainsMock stdChainsMock = new StdChainsMock();
vm.expectRevert("StdChains getChain(string): Chain with alias \"does_not_exist\" not found.");
stdChainsMock.exposed_getChain("does_not_exist");
}
I am not sure how exactly to rename tests.
Simple way would be changing from test_ChainNoDefault() to the test_RevertIf_ChainNoDefault() .
But I think this doesn't make a lot of sense, so I was about to rename the test like this : test_RevertIf_ChainNotFound() .
Just wanted to know which is a preferred way? Should I just add _RevertIf_ part where needed, or change tests names completely, where it makes sense to do so?
In the Foundry Book in Best Practices section there is a recommended way of naming tests, but the tests in this repo do not conform to this best practice. This is already issued in #273 .
I am open to rename those tests myself, but I just wanted to ask for some guidance before I make the changes.
Quick example : https://github.com/foundry-rs/forge-std/blob/1ce7535a517406b9aec7ea1ea27c1b41376f712c/test/StdChains.t.sol#L87
In the
test/StdChains.t.sol
there is a test that looks like this ->I am not sure how exactly to rename tests.
test_ChainNoDefault()
to thetest_RevertIf_ChainNoDefault()
.test_RevertIf_ChainNotFound()
.Just wanted to know which is a preferred way? Should I just add
_RevertIf_
part where needed, or change tests names completely, where it makes sense to do so?