Skip to content

Commit fde1321

Browse files
committed
Remove Execs::run_expect_error to avoid #14076
1 parent afe9d17 commit fde1321

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

crates/cargo-test-support/src/lib.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -915,15 +915,6 @@ impl Execs {
915915
}
916916
}
917917

918-
#[track_caller]
919-
pub fn run_expect_error(&mut self) {
920-
self.ran = true;
921-
let p = (&self.process_builder).clone().unwrap();
922-
if self.match_process(&p).is_ok() {
923-
panic!("test was expected to fail, but succeeded running {}", p);
924-
}
925-
}
926-
927918
/// Runs the process, checks the expected output, and returns the first
928919
/// JSON object on stdout.
929920
#[track_caller]

tests/testsuite/check_cfg.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,10 +632,11 @@ fn config_invalid_empty() {
632632
.build();
633633

634634
p.cargo("check")
635+
.with_status(101)
635636
.with_stderr_contains(
636637
"[..]missing field `level`[..] THIS RANDOM SENTENCE SHOULD FAIL THIS TEST BUT DIDN'T",
637638
)
638-
.run_expect_error();
639+
.run();
639640
}
640641

641642
#[cargo_test(>=1.79, reason = "--check-cfg was stabilized in Rust 1.79")]

tests/testsuite/freshness.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2933,6 +2933,7 @@ fn use_mtime_cache_in_cargo_home() {
29332933
p.change_file("src/lib.rs", "illegal syntax");
29342934
p.cargo("check -v")
29352935
.env("CARGO_HOME", &cargo_home)
2936+
.with_status(101)
29362937
.with_stderr(
29372938
"\
29382939
[DIRTY] foo v0.5.0 ([CWD]): [..]
@@ -2942,5 +2943,5 @@ fn use_mtime_cache_in_cargo_home() {
29422943
[CHECKING] foo v0.5.0 ([CWD])
29432944
[RUNNING] `rustc --crate-name foo --edition=2015 src/lib.rs [..]",
29442945
)
2945-
.run_expect_error();
2946+
.run();
29462947
}

0 commit comments

Comments
 (0)