fix(test): Ensure panics show test code, not lib

This commit is contained in:
Ed Page 2024-06-07 15:15:16 -05:00
parent 2b7e335946
commit 15e3412b2f

View File

@ -908,6 +908,7 @@ impl Execs {
}
}
#[track_caller]
fn verify_checks_output(&self, stdout: &[u8], stderr: &[u8]) {
if self.expect_exit_code.unwrap_or(0) != 0
&& self.expect_stdout.is_none()
@ -934,6 +935,7 @@ impl Execs {
}
}
#[track_caller]
fn match_process(&self, process: &ProcessBuilder) -> Result<RawOutput> {
println!("running {}", process);
let res = if self.stream_output {
@ -984,6 +986,7 @@ impl Execs {
}
}
#[track_caller]
fn match_output(&self, code: Option<i32>, stdout: &[u8], stderr: &[u8]) -> Result<()> {
self.verify_checks_output(stdout, stderr);
let stdout = std::str::from_utf8(stdout).expect("stdout is not utf8");