Updated constraint system tests

This commit is contained in:
Svetlana Isakova
2015-06-27 15:50:39 +03:00
parent cf64687b02
commit 1463ff7258
22 changed files with 37 additions and 17 deletions
@@ -105,15 +105,14 @@ abstract public class AbstractConstraintSystemTest() : JetLiteFixture() {
val resultingStatus = Renderers.RENDER_CONSTRAINT_SYSTEM_SHORT.render(constraintSystem)
val resultingSubstitutor = constraintSystem.getResultingSubstitutor()
val result = StringBuilder() append "result:\n"
for (typeParameter in typeParameterDescriptors) {
val parameterType = testDeclarations.getType(typeParameter.getName().asString())
val result = typeParameterDescriptors.map {
val parameterType = testDeclarations.getType(it.getName().asString())
val resultType = resultingSubstitutor.substitute(parameterType, Variance.INVARIANT)
result append "${typeParameter.getName()}=${resultType?.let{ DescriptorRenderer.SHORT_NAMES_IN_TYPES.renderType(it) }}\n"
}
"${it.getName()}=${resultType?.let{ DescriptorRenderer.SHORT_NAMES_IN_TYPES.renderType(it) }}"
}.join("\n", prefix = "result:\n")
val boundsFile = File(filePath.replace("constraints", "bounds"))
JetTestUtils.assertEqualsToFile(boundsFile, "$constraintsFileText\n\n$resultingStatus\n\n$result\n")
JetTestUtils.assertEqualsToFile(boundsFile, "$constraintsFileText\n\n$resultingStatus\n\n$result")
}
class MyConstraint(val kind: MyConstraintKind, val firstType: String, val secondType: String, val isWeak: Boolean)