Skip to content

Commit 7a1f8fe

Browse files
authored
test: rm unused repros (#11963)
1 parent e4c6951 commit 7a1f8fe

File tree

6 files changed

+21
-90
lines changed

6 files changed

+21
-90
lines changed

crates/forge/src/runner.rs

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -383,23 +383,14 @@ impl<'a> ContractRunner<'a> {
383383
load_contracts(setup.traces.iter().map(|(_, t)| &t.arena), &self.mcr.known_contracts)
384384
});
385385

386-
let test_fail_instances = functions
387-
.iter()
388-
.filter_map(|func| {
389-
TestFunctionKind::classify(&func.name, !func.inputs.is_empty())
390-
.is_any_test_fail()
391-
.then_some(func.name.clone())
392-
})
393-
.collect::<Vec<_>>();
394-
395-
if !test_fail_instances.is_empty() {
396-
let instances = format!(
397-
"Found {} instances: {}",
398-
test_fail_instances.len(),
399-
test_fail_instances.join(", ")
400-
);
401-
let fail = TestResult::fail("`testFail*` has been removed. Consider changing to test_Revert[If|When]_Condition and expecting a revert".to_string());
402-
return SuiteResult::new(start.elapsed(), [(instances, fail)].into(), warnings);
386+
let test_fail_functions =
387+
functions.iter().filter(|func| func.test_function_kind().is_any_test_fail());
388+
if test_fail_functions.clone().next().is_some() {
389+
let fail = || {
390+
TestResult::fail("`testFail*` has been removed. Consider changing to test_Revert[If|When]_Condition and expecting a revert".to_string())
391+
};
392+
let test_results = test_fail_functions.map(|func| (func.signature(), fail())).collect();
393+
return SuiteResult::new(start.elapsed(), test_results, warnings);
403394
}
404395

405396
let fail_fast = &self.tcfg.fail_fast;

crates/forge/tests/cli/failure_assertions.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,21 @@ forgetest!(test_fail_deprecation, |prj, cmd| {
1919
"#,
2020
);
2121

22-
cmd.forge_fuse().args(["test", "--mc", "DeprecationTestFail"]).assert_failure().stdout_eq(
23-
r#"[COMPILING_FILES] with [SOLC_VERSION]
22+
cmd.forge_fuse()
23+
.args(["test", "--mc", "DeprecationTestFail"])
24+
.assert_failure()
25+
.stdout_eq(str![[r#"
26+
[COMPILING_FILES] with [SOLC_VERSION]
2427
[SOLC_VERSION] [ELAPSED]
2528
...
26-
[FAIL: `testFail*` has been removed. Consider changing to test_Revert[If|When]_Condition and expecting a revert] Found 2 instances: testFail_deprecated, testFail_deprecated2 ([GAS])
27-
Suite result: FAILED. 0 passed; 1 failed; 0 skipped; [ELAPSED]
28-
...
29-
"#,
30-
);
29+
Failing tests:
30+
Encountered 2 failing tests in src/DeprecationTestFail.t.sol:DeprecationTestFail
31+
[FAIL: `testFail*` has been removed. Consider changing to test_Revert[If|When]_Condition and expecting a revert] testFail_deprecated() ([GAS])
32+
[FAIL: `testFail*` has been removed. Consider changing to test_Revert[If|When]_Condition and expecting a revert] testFail_deprecated2() ([GAS])
33+
34+
Encountered a total of 2 failing tests, 0 tests succeeded
35+
36+
"#]]);
3137
});
3238

3339
forgetest!(expect_revert_tests_should_fail, |prj, cmd| {

crates/forge/tests/it/repros.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,6 @@ test_repro!(3347, false, None, |res| {
142142
);
143143
});
144144

145-
// https://github.com/foundry-rs/foundry/issues/3437
146-
// 1.0 related
147-
// test_repro!(3437);
148-
149145
// https://github.com/foundry-rs/foundry/issues/3596
150146
test_repro!(3596, true, None);
151147

@@ -170,10 +166,6 @@ test_repro!(
170166
// https://github.com/foundry-rs/foundry/issues/3708
171167
test_repro!(3708);
172168

173-
// https://github.com/foundry-rs/foundry/issues/3723
174-
// 1.0 related
175-
// test_repro!(3723);
176-
177169
// https://github.com/foundry-rs/foundry/issues/3753
178170
test_repro!(3753);
179171

@@ -195,10 +187,6 @@ test_repro!(4630);
195187
// https://github.com/foundry-rs/foundry/issues/4640
196188
test_repro!(4640);
197189

198-
// https://github.com/foundry-rs/foundry/issues/4832
199-
// 1.0 related
200-
// test_repro!(4832);
201-
202190
// https://github.com/foundry-rs/foundry/issues/5038
203191
test_repro!(5038);
204192

testdata/default/repros/Issue3437.t.sol

Lines changed: 0 additions & 19 deletions
This file was deleted.

testdata/default/repros/Issue3723.t.sol

Lines changed: 0 additions & 18 deletions
This file was deleted.

testdata/default/repros/Issue4832.t.sol

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)