Skip to content

Commit 0f304ca

Browse files
committed
Fix verify_checks_output.
This was accidentally broken in cc5e9df causing it to not check in the error case (which is the only case that mattered).
1 parent 5d1b0f9 commit 0f304ca

File tree

1 file changed

+4
-4
lines changed
  • crates/cargo-test-support/src

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ impl Execs {
737737
}
738738
}
739739

740-
fn verify_checks_output(&self, output: &Output) {
740+
fn verify_checks_output(&self, stdout: &[u8], stderr: &[u8]) {
741741
if self.expect_exit_code.unwrap_or(0) != 0
742742
&& self.expect_stdout.is_none()
743743
&& self.expect_stdin.is_none()
@@ -758,8 +758,8 @@ impl Execs {
758758
"`with_status()` is used, but no output is checked.\n\
759759
The test must check the output to ensure the correct error is triggered.\n\
760760
--- stdout\n{}\n--- stderr\n{}",
761-
String::from_utf8_lossy(&output.stdout),
762-
String::from_utf8_lossy(&output.stderr),
761+
String::from_utf8_lossy(stdout),
762+
String::from_utf8_lossy(stderr),
763763
);
764764
}
765765
}
@@ -806,13 +806,13 @@ impl Execs {
806806
}
807807

808808
fn match_output(&self, actual: &Output) -> Result<()> {
809-
self.verify_checks_output(actual);
810809
self.match_status(actual.status.code(), &actual.stdout, &actual.stderr)
811810
.and(self.match_stdout(&actual.stdout, &actual.stderr))
812811
.and(self.match_stderr(&actual.stdout, &actual.stderr))
813812
}
814813

815814
fn match_status(&self, code: Option<i32>, stdout: &[u8], stderr: &[u8]) -> Result<()> {
815+
self.verify_checks_output(stdout, stderr);
816816
match self.expect_exit_code {
817817
None => Ok(()),
818818
Some(expected) if code == Some(expected) => Ok(()),

0 commit comments

Comments
 (0)