mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Remove Execs::run_expect_error
to avoid #14076
This commit is contained in:
parent
afe9d17258
commit
fde1321381
@ -915,15 +915,6 @@ impl Execs {
|
||||
}
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
pub fn run_expect_error(&mut self) {
|
||||
self.ran = true;
|
||||
let p = (&self.process_builder).clone().unwrap();
|
||||
if self.match_process(&p).is_ok() {
|
||||
panic!("test was expected to fail, but succeeded running {}", p);
|
||||
}
|
||||
}
|
||||
|
||||
/// Runs the process, checks the expected output, and returns the first
|
||||
/// JSON object on stdout.
|
||||
#[track_caller]
|
||||
|
@ -632,10 +632,11 @@ fn config_invalid_empty() {
|
||||
.build();
|
||||
|
||||
p.cargo("check")
|
||||
.with_status(101)
|
||||
.with_stderr_contains(
|
||||
"[..]missing field `level`[..] THIS RANDOM SENTENCE SHOULD FAIL THIS TEST BUT DIDN'T",
|
||||
)
|
||||
.run_expect_error();
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test(>=1.79, reason = "--check-cfg was stabilized in Rust 1.79")]
|
||||
|
@ -2933,6 +2933,7 @@ fn use_mtime_cache_in_cargo_home() {
|
||||
p.change_file("src/lib.rs", "illegal syntax");
|
||||
p.cargo("check -v")
|
||||
.env("CARGO_HOME", &cargo_home)
|
||||
.with_status(101)
|
||||
.with_stderr(
|
||||
"\
|
||||
[DIRTY] foo v0.5.0 ([CWD]): [..]
|
||||
@ -2942,5 +2943,5 @@ fn use_mtime_cache_in_cargo_home() {
|
||||
[CHECKING] foo v0.5.0 ([CWD])
|
||||
[RUNNING] `rustc --crate-name foo --edition=2015 src/lib.rs [..]",
|
||||
)
|
||||
.run_expect_error();
|
||||
.run();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user