File tree Expand file tree Collapse file tree 3 files changed +4
-11
lines changed
crates/cargo-test-support/src Expand file tree Collapse file tree 3 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -915,15 +915,6 @@ impl Execs {
915
915
}
916
916
}
917
917
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
-
927
918
/// Runs the process, checks the expected output, and returns the first
928
919
/// JSON object on stdout.
929
920
#[ track_caller]
Original file line number Diff line number Diff line change @@ -632,10 +632,11 @@ fn config_invalid_empty() {
632
632
. build ( ) ;
633
633
634
634
p. cargo ( "check" )
635
+ . with_status ( 101 )
635
636
. with_stderr_contains (
636
637
"[..]missing field `level`[..] THIS RANDOM SENTENCE SHOULD FAIL THIS TEST BUT DIDN'T" ,
637
638
)
638
- . run_expect_error ( ) ;
639
+ . run ( ) ;
639
640
}
640
641
641
642
#[ cargo_test( >=1.79 , reason = "--check-cfg was stabilized in Rust 1.79" ) ]
Original file line number Diff line number Diff line change @@ -2933,6 +2933,7 @@ fn use_mtime_cache_in_cargo_home() {
2933
2933
p. change_file ( "src/lib.rs" , "illegal syntax" ) ;
2934
2934
p. cargo ( "check -v" )
2935
2935
. env ( "CARGO_HOME" , & cargo_home)
2936
+ . with_status ( 101 )
2936
2937
. with_stderr (
2937
2938
"\
2938
2939
[DIRTY] foo v0.5.0 ([CWD]): [..]
@@ -2942,5 +2943,5 @@ fn use_mtime_cache_in_cargo_home() {
2942
2943
[CHECKING] foo v0.5.0 ([CWD])
2943
2944
[RUNNING] `rustc --crate-name foo --edition=2015 src/lib.rs [..]" ,
2944
2945
)
2945
- . run_expect_error ( ) ;
2946
+ . run ( ) ;
2946
2947
}
You can’t perform that action at this time.
0 commit comments