-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
C-forgeCommand: forgeCommand: forgeCmd-forge-testCommand: forge testCommand: forge testT-bugType: bugType: bug
Milestone
Description
Component
Forge
Have you ensured that all of these are up to date?
- Foundry
- Foundryup
What version of Foundry are you on?
1.3.0-nightly 56b806a
What version of Foundryup are you on?
1.3.0
What command(s) is the bug in?
forge test
Operating System
Linux
Describe the bug
Hey,
I don't know if this is intentional, but with the following test contract, console logs are only emitted for the last iteration.
pragma solidity ^0.8.30;
import {Test} from "forge-std/Test.sol";
import {console} from "forge-std/console.sol";
contract MyTest is Test {
function fixtureStr() public pure returns (string[2] memory strings) {
strings[0] = "first";
strings[1] = "second";
}
function tableStrTest(string memory str) public pure {
console.log(str);
}
}Running forge test:
[PASS] tableStrTest(string) (gas: 3464)
Logs:
second
The same thing also applies to gas snapshots, where only snapshots made in the last iteration are recorded.
Potential code section that causes this behavior: https://github.com/grandizzy/foundry/blob/887a282cca0fd1c38072fa8e1ede896d06c7b94c/crates/forge/src/runner.rs#L670-L675
Metadata
Metadata
Assignees
Labels
C-forgeCommand: forgeCommand: forgeCmd-forge-testCommand: forge testCommand: forge testT-bugType: bugType: bug
Type
Projects
Status
Done