Skip to content

Commit 2b9c2b3

Browse files
committed
Make it clear that the file is the red part of the diff and the actual stderr output is the green part
1 parent e3620d4 commit 2b9c2b3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,9 @@ pub fn run_tests_generic(config: Config, file_filter: impl Fn(&Path) -> bool + S
322322
actual,
323323
expected,
324324
} => {
325-
eprintln!("actual output differed from expected {}", path.display());
325+
eprintln!("{}", "actual output differed from expected".underline());
326+
eprintln!("{}", format!("--- {}", path.display()).red());
327+
eprintln!("{}", "+++ <stderr output>".green());
326328
diff::print_diff(expected, actual);
327329
}
328330
Error::ErrorsWithoutPattern { path: None, msgs } => {

tests/integrations/basic-fail/Cargo.stderr

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ For more information about this error, try `rustc --explain E0308`.
3939
tests/actual_tests/foomp.rs FAILED:
4040
command: "rustc" "--error-format=json" "--edition=2021" "--extern" "basic_fail=$DIR/$DIR/../../../target/debug/libbasic_fail-$HASH.rmeta" "-L" "$DIR/$DIR/../../../target/debug" "-L" "$DIR/$DIR/../../../target/debug" "tests/actual_tests/foomp.rs"
4141

42-
actual output differed from expected tests/actual_tests/foomp.stderr
42+
actual output differed from expected
43+
--- tests/actual_tests/foomp.stderr
44+
+++ <stderr output>
4345
... 3 lines skipped ...
4446
4 | add("42", 3);
4547
| --- ^^^^ expected `usize`, found `&str`

0 commit comments

Comments
 (0)