Skip to content

Commit 6f2ca45

Browse files
committed
Rename left/right/base/reference to a consistent expected/actual so that reading, labeling, and testing TreeDiffer doesn't require mental gymnastics.
Also reverse order of expected and actual arguments in TreeDiffer to be consistent with convention and to fix previously incorrect labeling of expected / actual tree diffs. ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=67161240
1 parent 30eeb19 commit 6f2ca45

File tree

6 files changed

+521
-468
lines changed

6 files changed

+521
-468
lines changed

src/main/java/com/google/testing/compile/JavaSourcesSubject.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,11 @@ public SuccessfulCompilationClause generatesSources(JavaFileObject first,
308308
actualTreeTypes, actualTrees);
309309
} else {
310310
CompilationUnitTree actualTree = matchedTreePair.getValue().get();
311-
TreeDifference treeDifference = TreeDiffer.diffCompilationUnits(actualTree, expectedTree);
311+
TreeDifference treeDifference = TreeDiffer.diffCompilationUnits(expectedTree, actualTree);
312312
if (!treeDifference.isEmpty()) {
313313
String diffReport = treeDifference.getDiffReport(
314-
new TreeContext(actualTree, actualResult.trees()),
315-
new TreeContext(expectedTree, expectedResult.trees()));
314+
new TreeContext(expectedTree, expectedResult.trees()),
315+
new TreeContext(actualTree, actualResult.trees()));
316316
failWithCandidate(expectedTree.getSourceFile(), actualTree.getSourceFile(), diffReport);
317317
}
318318
}

0 commit comments

Comments
 (0)