@@ -472,9 +472,10 @@ impl Project {
472
472
/// # Example:
473
473
///
474
474
/// ```no_run
475
+ /// # use cargo_test_support::str;
475
476
/// # let p = cargo_test_support::project().build();
476
477
/// p.process(&p.bin("foo"))
477
- /// .with_stdout( "bar\n")
478
+ /// .with_stdout_data(str![ "bar\n"] )
478
479
/// .run();
479
480
/// ```
480
481
pub fn process < T : AsRef < OsStr > > ( & self , program : T ) -> Execs {
@@ -644,9 +645,7 @@ struct RawOutput {
644
645
pub struct Execs {
645
646
ran : bool ,
646
647
process_builder : Option < ProcessBuilder > ,
647
- expect_stdout : Option < String > ,
648
648
expect_stdin : Option < String > ,
649
- expect_stderr : Option < String > ,
650
649
expect_exit_code : Option < i32 > ,
651
650
expect_stdout_data : Option < snapbox:: Data > ,
652
651
expect_stderr_data : Option < snapbox:: Data > ,
@@ -673,22 +672,6 @@ impl Execs {
673
672
674
673
/// # Configure assertions
675
674
impl Execs {
676
- /// Verifies that stdout is equal to the given lines.
677
- /// See [`compare`] for supported patterns.
678
- #[ deprecated( note = "replaced with `Execs::with_stdout_data(expected)`" ) ]
679
- pub fn with_stdout < S : ToString > ( & mut self , expected : S ) -> & mut Self {
680
- self . expect_stdout = Some ( expected. to_string ( ) ) ;
681
- self
682
- }
683
-
684
- /// Verifies that stderr is equal to the given lines.
685
- /// See [`compare`] for supported patterns.
686
- #[ deprecated( note = "replaced with `Execs::with_stderr_data(expected)`" ) ]
687
- pub fn with_stderr < S : ToString > ( & mut self , expected : S ) -> & mut Self {
688
- self . expect_stderr = Some ( expected. to_string ( ) ) ;
689
- self
690
- }
691
-
692
675
/// Verifies that stdout is equal to the given lines.
693
676
///
694
677
/// See [`compare::assert_e2e`] for assertion details.
@@ -1058,9 +1041,7 @@ impl Execs {
1058
1041
#[ track_caller]
1059
1042
fn verify_checks_output ( & self , stdout : & [ u8 ] , stderr : & [ u8 ] ) {
1060
1043
if self . expect_exit_code . unwrap_or ( 0 ) != 0
1061
- && self . expect_stdout . is_none ( )
1062
1044
&& self . expect_stdin . is_none ( )
1063
- && self . expect_stderr . is_none ( )
1064
1045
&& self . expect_stdout_data . is_none ( )
1065
1046
&& self . expect_stderr_data . is_none ( )
1066
1047
&& self . expect_stdout_contains . is_empty ( )
@@ -1154,12 +1135,6 @@ impl Execs {
1154
1135
) ,
1155
1136
}
1156
1137
1157
- if let Some ( expect_stdout) = & self . expect_stdout {
1158
- compare:: match_exact ( expect_stdout, stdout, "stdout" , stderr, cwd) ?;
1159
- }
1160
- if let Some ( expect_stderr) = & self . expect_stderr {
1161
- compare:: match_exact ( expect_stderr, stderr, "stderr" , stdout, cwd) ?;
1162
- }
1163
1138
if let Some ( expect_stdout_data) = & self . expect_stdout_data {
1164
1139
if let Err ( err) = self . assert . try_eq (
1165
1140
Some ( & "stdout" ) ,
@@ -1227,8 +1202,6 @@ pub fn execs() -> Execs {
1227
1202
Execs {
1228
1203
ran : false ,
1229
1204
process_builder : None ,
1230
- expect_stdout : None ,
1231
- expect_stderr : None ,
1232
1205
expect_stdin : None ,
1233
1206
expect_exit_code : Some ( 0 ) ,
1234
1207
expect_stdout_data : None ,
0 commit comments