diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2018-02-03 02:51:16 +0200 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2018-02-03 02:51:16 +0200 |
| commit | cc68afb38476c6ebf53b3dab302a2760cb9374b9 (patch) | |
| tree | 72a5f500d127ebeccb556a43619a8c828cbd39a5 | |
| parent | 26792f0607bea2b03daa5195c2688fd53289042b (diff) | |
| download | rust-cc68afb38476c6ebf53b3dab302a2760cb9374b9.tar.gz rust-cc68afb38476c6ebf53b3dab302a2760cb9374b9.zip | |
ui tests: diff from old (expected) to new (actual) instead of backwards.
| -rw-r--r-- | src/tools/compiletest/src/runtest.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index abf62a060b8..46df211cbaf 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -79,7 +79,7 @@ pub fn make_diff(expected: &str, actual: &str, context_size: usize) -> Vec<Misma let mut results = Vec::new(); let mut mismatch = Mismatch::new(0); - for result in diff::lines(actual, expected) { + for result in diff::lines(expected, actual) { match result { diff::Result::Left(str) => { if lines_since_mismatch >= context_size && lines_since_mismatch > 0 { @@ -91,7 +91,8 @@ pub fn make_diff(expected: &str, actual: &str, context_size: usize) -> Vec<Misma mismatch.lines.push(DiffLine::Context(line.to_owned())); } - mismatch.lines.push(DiffLine::Resulting(str.to_owned())); + mismatch.lines.push(DiffLine::Expected(str.to_owned())); + line_number += 1; lines_since_mismatch = 0; } diff::Result::Right(str) => { @@ -104,8 +105,7 @@ pub fn make_diff(expected: &str, actual: &str, context_size: usize) -> Vec<Misma mismatch.lines.push(DiffLine::Context(line.to_owned())); } - mismatch.lines.push(DiffLine::Expected(str.to_owned())); - line_number += 1; + mismatch.lines.push(DiffLine::Resulting(str.to_owned())); lines_since_mismatch = 0; } diff::Result::Both(str, _) => { |
