extract test of unit

This commit is contained in:
Till Schnell 2021-03-27 18:06:28 +01:00
parent 59b45b5f87
commit cbe2d7b0f5

View File

@ -49,17 +49,21 @@ public class TestInferWildcards
for (CompilationUnitTree t : iterable) { for (CompilationUnitTree t : iterable) {
System.out.println("unit: " + t.toString()); System.out.println("unit: " + t.toString());
InferWildcardsVisitor inferWildcardsVisitor = new InferWildcardsVisitor(); testUnit(t);
t.accept(inferWildcardsVisitor, null);
// Generated Constraints
ConstraintSet constraintSet = inferWildcardsVisitor.getConstraintSet();
System.out.println("Constraints: " + constraintSet);
// Generated TPH
Map<TypePlaceholder, Tree> placeholderMapping = inferWildcardsVisitor.getPlaceholderMapping();
System.out.println("Placeholder: " + placeholderMapping.toString());
} }
} }
@SuppressWarnings("rawtypes")
private void testUnit (CompilationUnitTree t) {
InferWildcardsVisitor inferWildcardsVisitor = new InferWildcardsVisitor();
t.accept(inferWildcardsVisitor, null);
// Generated Constraints
ConstraintSet constraintSet = inferWildcardsVisitor.getConstraintSet();
System.out.println("Constraints: " + constraintSet);
// Generated TPH
Map<TypePlaceholder, Tree> placeholderMapping = inferWildcardsVisitor.getPlaceholderMapping();
System.out.println("Placeholder: " + placeholderMapping.toString());
}
} }