Skip to content

Commit dffdfde

Browse files
Sabnock01Evalir
andauthored
chore: update CounterTemplate.t.sol to adhere to best practices (#5619)
* chore: update test template to adhere to best practices * fix: update fixtures * fix: update fixture gas * reorder --------- Co-authored-by: Enrique Ortiz <[email protected]>
1 parent 3158028 commit dffdfde

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

crates/cli/assets/CounterTemplate.t.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ contract CounterTest is Test {
1212
counter.setNumber(0);
1313
}
1414

15-
function testIncrement() public {
15+
function test_Increment() public {
1616
counter.increment();
1717
assertEq(counter.number(), 1);
1818
}
1919

20-
function testSetNumber(uint256 x) public {
20+
function testFuzz_SetNumber(uint256 x) public {
2121
counter.setNumber(x);
2222
assertEq(counter.number(), x);
2323
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
No files changed, compilation skipped
22

33
Running 2 tests for test/Counter.t.sol:CounterTest
4-
[PASS] testIncrement() (gas: 28334)
5-
[PASS] testSetNumber(uint256) (runs: 256, μ: 26521, ~: 28387)
4+
[PASS] testFuzz_SetNumber(uint256) (runs: 256, μ: 26521, ~: 28387)
5+
[PASS] test_Increment() (gas: 28357)
66
Test result: ok. 2 passed; 0 failed; 0 skipped; finished in 9.42ms
77
Ran 1 test suites: 2 tests passed, 0 failed, 0 skipped (2 total tests)

crates/config/src/inline/natspec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl NatSpec {
4646

4747
/// Returns a string describing the natspec
4848
/// context, for debugging purposes 🐞
49-
/// i.e. `test/Counter.t.sol:CounterTest:testSetNumber`
49+
/// i.e. `test/Counter.t.sol:CounterTest:testFuzz_SetNumber`
5050
pub fn debug_context(&self) -> String {
5151
format!("{}:{}", self.contract, self.function)
5252
}

0 commit comments

Comments
 (0)