Skip to content

Commit 9739e8d

Browse files
authored
Rollup merge of #42144 - cengizIO:master, r=nikomatsakis
make ui test output patch compatible #41948 Hello! Previously with #41474 I've changed the internals of UI test output comparison mechanism. That change didn't change the diff format that we were producing but we needed to improve it anyway. This makes unified diff lines a little bit more `patch` compatible. Also I tried to introduce a unit test to check this but couldn't decide which of the following to implement: 1. Should I replace `println` macros with `Writer`s? And access the produced output within a test? 2. Should I add an external test (something like `src/test/run-pass/command-exec.rs`) 3. There are crates that capture `stdout`. Are they safe to use here? (I don't think so) Thanks! cc @nikomatsakis
2 parents 7a7e236 + 9111d07 commit 9739e8d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/tools/compiletest/src/runtest.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2415,11 +2415,11 @@ actual:\n\
24152415
println!("expected {}:\n{}\n", kind, expected);
24162416
println!("diff of {}:\n", kind);
24172417

2418-
for diff in diff::lines(actual, expected) {
2418+
for diff in diff::lines(expected, actual) {
24192419
match diff {
2420-
diff::Result::Left(l) => println!("+{}", l),
2420+
diff::Result::Left(l) => println!("-{}", l),
24212421
diff::Result::Both(l, _) => println!(" {}", l),
2422-
diff::Result::Right(r) => println!("-{}", r),
2422+
diff::Result::Right(r) => println!("+{}", r),
24232423
}
24242424
}
24252425

0 commit comments

Comments
 (0)