diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-05-23 00:15:43 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-05-23 00:15:43 -0400 |
| commit | 9739e8dbc9e65a7ccbba65d987c0491804796c7b (patch) | |
| tree | c90fc9241b1b9210220e962137af21c54c8762ce | |
| parent | 7a7e2360765e5ce2eb0ad5da409da24f440dc68f (diff) | |
| parent | 9111d07a6ea8dad2685e8d39bffd654f231a24c2 (diff) | |
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
| -rw-r--r-- | src/tools/compiletest/src/runtest.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 911f3c51f5f..1bec6f6af83 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -2415,11 +2415,11 @@ actual:\n\ println!("expected {}:\n{}\n", kind, expected); println!("diff of {}:\n", kind); - for diff in diff::lines(actual, expected) { + for diff in diff::lines(expected, actual) { match diff { - diff::Result::Left(l) => println!("+{}", l), + diff::Result::Left(l) => println!("-{}", l), diff::Result::Both(l, _) => println!(" {}", l), - diff::Result::Right(r) => println!("-{}", r), + diff::Result::Right(r) => println!("+{}", r), } } |
