Skip to content

Commit 297b177

Browse files
authored
Merge pull request #1677 from dwijnand/rustup-mock-tweaks
Add some debugging utilities to rustup-mock
2 parents b645126 + 1ba104c commit 297b177

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/rustup-mock/src/clitools.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ pub fn expect_ok_ex(config: &Config, args: &[&str], stdout: &str, stderr: &str)
225225
println!("expected.ok: {}", true);
226226
print_indented("expected.stdout", stdout);
227227
print_indented("expected.stderr", stderr);
228+
dbg!(out.stdout == stdout);
229+
dbg!(out.stderr == stderr);
228230
panic!();
229231
}
230232
}
@@ -267,7 +269,12 @@ fn print_command(args: &[&str], out: &SanitizedOutput) {
267269
}
268270

269271
fn print_indented(heading: &str, text: &str) {
270-
println!("{}:\n {}", heading, text.replace("\n", "\n "));
272+
println!(
273+
"{} ({} lines):\n {}",
274+
heading,
275+
text.lines().count(),
276+
text.replace("\n", "\n ")
277+
);
271278
}
272279

273280
#[derive(Debug)]

0 commit comments

Comments
 (0)