@@ -1126,8 +1126,8 @@ Ran 1 test suite [ELAPSED]: 1 tests passed, 0 failed, 0 skipped (1 total tests)
11261126"# ] ] ) ;
11271127} ) ;
11281128
1129- // tests that `forge test` with config `show_logs: false` for fuzz tests will not display
1130- // `console.log` info
1129+ // tests that `forge test` with config `show_logs: false` for fuzz tests will
1130+ // still display `console.log` from the last run at verbosity >= 2 (issue #11039)
11311131forgetest_init ! ( should_not_show_logs_when_fuzz_test, |prj, cmd| {
11321132 // run fuzz test 3 times
11331133 prj. update_config( |config| {
@@ -1149,22 +1149,26 @@ forgetest_init!(should_not_show_logs_when_fuzz_test, |prj, cmd| {
11491149 }
11501150 "# ,
11511151 ) ;
1152+ // At verbosity >= 2, logs from the last run should be shown even when show_logs is false
11521153 cmd. args( [ "test" , "-vv" ] ) . assert_success( ) . stdout_eq( str ![ [ r#"
11531154[COMPILING_FILES] with [SOLC_VERSION]
11541155[SOLC_VERSION] [ELAPSED]
11551156Compiler run successful!
11561157
11571158Ran 1 test for test/ContractFuzz.t.sol:ContractFuzz
11581159[PASS] testFuzzConsoleLog(uint256) (runs: 3, [AVG_GAS])
1160+ Logs:
1161+ inside fuzz test, x is: [..]
1162+
11591163Suite result: ok. 1 passed; 0 failed; 0 skipped; [ELAPSED]
11601164
11611165Ran 1 test suite [ELAPSED]: 1 tests passed, 0 failed, 0 skipped (1 total tests)
11621166
11631167"# ] ] ) ;
11641168} ) ;
11651169
1166- // tests that `forge test` with inline config `show_logs = false` for fuzz tests will not
1167- // display `console.log` info
1170+ // tests that `forge test` with inline config `show_logs = false` for fuzz tests will
1171+ // still display `console.log` from the last run at verbosity >= 2 (issue #11039)
11681172forgetest_init ! ( should_not_show_logs_when_fuzz_test_inline_config, |prj, cmd| {
11691173 // run fuzz test 3 times
11701174 prj. update_config( |config| {
@@ -1186,13 +1190,17 @@ contract ContractFuzz is Test {
11861190}
11871191 "# ,
11881192 ) ;
1193+ // At verbosity >= 2, logs from the last run should be shown even when show_logs is false
11891194 cmd. args( [ "test" , "-vv" ] ) . assert_success( ) . stdout_eq( str ![ [ r#"
11901195[COMPILING_FILES] with [SOLC_VERSION]
11911196[SOLC_VERSION] [ELAPSED]
11921197Compiler run successful!
11931198
11941199Ran 1 test for test/ContractFuzz.t.sol:ContractFuzz
11951200[PASS] testFuzzConsoleLog(uint256) (runs: 3, [AVG_GAS])
1201+ Logs:
1202+ inside fuzz test, x is: [..]
1203+
11961204Suite result: ok. 1 passed; 0 failed; 0 skipped; [ELAPSED]
11971205
11981206Ran 1 test suite [ELAPSED]: 1 tests passed, 0 failed, 0 skipped (1 total tests)
0 commit comments