Added more tests on incorporation

This commit is contained in:
Svetlana Isakova
2015-07-02 19:56:36 +03:00
parent 4c1eedce3b
commit fc69cf1b5e
26 changed files with 425 additions and 1 deletions
@@ -10,4 +10,5 @@ interface Producer<out T>
interface My<T>
interface Successor<T> : My<T>
interface Two<T, P>
interface Two<T, P>
interface Fun<in T, out R>
@@ -0,0 +1,23 @@
VARIABLES T P
SUBTYPE T? P?
SUBTYPE P Int
type parameter bounds:
T <: P?*, <: P*, <: Int, <: Int?
P >: T*, <: Int
status:
-hasCannotCaptureTypesError: false
-hasConflictingConstraints: false
-hasContradiction: false
-hasErrorInConstrainingTypes: false
-hasTypeConstructorMismatch: false
-hasTypeInferenceIncorporationError: false
-hasUnknownParameters: false
-hasViolatedUpperBound: false
-isSuccessful: true
result:
T=Int
P=Int
@@ -0,0 +1,4 @@
VARIABLES T P
SUBTYPE T? P?
SUBTYPE P Int
@@ -0,0 +1,23 @@
VARIABLES T P
SUBTYPE Int T
EQUAL P Consumer<Consumer<T>>
type parameter bounds:
T >: Int
P := Consumer<Consumer<T>>*, >: Consumer<Consumer<Int>>
status:
-hasCannotCaptureTypesError: false
-hasConflictingConstraints: false
-hasContradiction: false
-hasErrorInConstrainingTypes: false
-hasTypeConstructorMismatch: false
-hasTypeInferenceIncorporationError: false
-hasUnknownParameters: false
-hasViolatedUpperBound: false
-isSuccessful: true
result:
T=Int
P=Consumer<Consumer<Int>>
@@ -0,0 +1,4 @@
VARIABLES T P
SUBTYPE Int T
EQUAL P Consumer<Consumer<T>>
@@ -0,0 +1,23 @@
VARIABLES T P
SUBTYPE Int T
SUBTYPE P Consumer<Consumer<Consumer<T>>>
type parameter bounds:
T >: Int
P <: Consumer<Consumer<Consumer<T>>>*, <: Consumer<Consumer<Consumer<Int>>>
status:
-hasCannotCaptureTypesError: false
-hasConflictingConstraints: false
-hasContradiction: false
-hasErrorInConstrainingTypes: false
-hasTypeConstructorMismatch: false
-hasTypeInferenceIncorporationError: false
-hasUnknownParameters: false
-hasViolatedUpperBound: false
-isSuccessful: true
result:
T=Int
P=Consumer<Consumer<Consumer<Int>>>
@@ -0,0 +1,4 @@
VARIABLES T P
SUBTYPE Int T
SUBTYPE P Consumer<Consumer<Consumer<T>>>
@@ -0,0 +1,23 @@
VARIABLES T P
SUBTYPE Int T
SUBTYPE P My<My<Consumer<T>>>
type parameter bounds:
T >: Int
P <: My<My<Consumer<T>>>*, <: My<out My<out Consumer<Int>>>
status:
-hasCannotCaptureTypesError: false
-hasConflictingConstraints: false
-hasContradiction: true
-hasErrorInConstrainingTypes: false
-hasTypeConstructorMismatch: false
-hasTypeInferenceIncorporationError: true
-hasUnknownParameters: false
-hasViolatedUpperBound: false
-isSuccessful: false
result:
T=Int
P=My<out My<out Consumer<Int>>>
@@ -0,0 +1,4 @@
VARIABLES T P
SUBTYPE Int T
SUBTYPE P My<My<Consumer<T>>>
@@ -0,0 +1,23 @@
VARIABLES T P
SUBTYPE T Int
SUBTYPE P My<My<Producer<T>>>
type parameter bounds:
T <: Int
P <: My<My<Producer<T>>>*, <: My<out My<out Producer<Int>>>
status:
-hasCannotCaptureTypesError: false
-hasConflictingConstraints: false
-hasContradiction: true
-hasErrorInConstrainingTypes: false
-hasTypeConstructorMismatch: false
-hasTypeInferenceIncorporationError: true
-hasUnknownParameters: false
-hasViolatedUpperBound: false
-isSuccessful: false
result:
T=Int
P=My<out My<out Producer<Int>>>
@@ -0,0 +1,4 @@
VARIABLES T P
SUBTYPE T Int
SUBTYPE P My<My<Producer<T>>>
@@ -0,0 +1,23 @@
VARIABLES T P
SUBTYPE T Int
SUBTYPE P Producer<Producer<Producer<T>>>
type parameter bounds:
T <: Int
P <: Producer<Producer<Producer<T>>>*, <: Producer<Producer<Producer<Int>>>
status:
-hasCannotCaptureTypesError: false
-hasConflictingConstraints: false
-hasContradiction: false
-hasErrorInConstrainingTypes: false
-hasTypeConstructorMismatch: false
-hasTypeInferenceIncorporationError: false
-hasUnknownParameters: false
-hasViolatedUpperBound: false
-isSuccessful: true
result:
T=Int
P=Producer<Producer<Producer<Int>>>
@@ -0,0 +1,4 @@
VARIABLES T P
SUBTYPE T Int
SUBTYPE P Producer<Producer<Producer<T>>>
@@ -0,0 +1,23 @@
VARIABLES T P
SUBTYPE Int T
SUBTYPE P Producer<Consumer<Producer<T>>>
type parameter bounds:
T >: Int
P <: Producer<Consumer<Producer<T>>>*, <: Producer<Consumer<Producer<Int>>>
status:
-hasCannotCaptureTypesError: false
-hasConflictingConstraints: false
-hasContradiction: false
-hasErrorInConstrainingTypes: false
-hasTypeConstructorMismatch: false
-hasTypeInferenceIncorporationError: false
-hasUnknownParameters: false
-hasViolatedUpperBound: false
-isSuccessful: true
result:
T=Int
P=Producer<Consumer<Producer<Int>>>
@@ -0,0 +1,4 @@
VARIABLES T P
SUBTYPE Int T
SUBTYPE P Producer<Consumer<Producer<T>>>
@@ -0,0 +1,23 @@
VARIABLES T P
SUBTYPE T Int
SUBTYPE P Fun<Consumer<T>,Producer<T>>
type parameter bounds:
T <: Int
P <: Fun<Consumer<T>, Producer<T>>*, <: Fun<Consumer<Int>, Producer<Int>>
status:
-hasCannotCaptureTypesError: false
-hasConflictingConstraints: false
-hasContradiction: false
-hasErrorInConstrainingTypes: false
-hasTypeConstructorMismatch: false
-hasTypeInferenceIncorporationError: false
-hasUnknownParameters: false
-hasViolatedUpperBound: false
-isSuccessful: true
result:
T=Int
P=Fun<Consumer<Int>, Producer<Int>>
@@ -0,0 +1,4 @@
VARIABLES T P
SUBTYPE T Int
SUBTYPE P Fun<Consumer<T>,Producer<T>>
@@ -0,0 +1,26 @@
VARIABLES T P E
SUBTYPE Int T
SUBTYPE P String
SUBTYPE E Fun<T, P>
type parameter bounds:
T >: Int
P <: String
E <: Fun<T, [ERROR : No type element]>*, <: Fun<Int, [ERROR : No type element]>
status:
-hasCannotCaptureTypesError: false
-hasConflictingConstraints: false
-hasContradiction: false
-hasErrorInConstrainingTypes: false
-hasTypeConstructorMismatch: false
-hasTypeInferenceIncorporationError: false
-hasUnknownParameters: false
-hasViolatedUpperBound: false
-isSuccessful: true
result:
T=Int
P=String
E=Fun<Int, [ERROR : No type element]>
@@ -0,0 +1,5 @@
VARIABLES T P E
SUBTYPE Int T
SUBTYPE P String
SUBTYPE E Fun<T, P>
@@ -0,0 +1,26 @@
VARIABLES T P E
SUBTYPE T P
SUBTYPE P E
SUBTYPE E Int
type parameter bounds:
T <: P*, <: E*, <: Int
P >: T*, <: E*, <: Int
E >: T*, >: P*, <: Int
status:
-hasCannotCaptureTypesError: false
-hasConflictingConstraints: false
-hasContradiction: false
-hasErrorInConstrainingTypes: false
-hasTypeConstructorMismatch: false
-hasTypeInferenceIncorporationError: false
-hasUnknownParameters: false
-hasViolatedUpperBound: false
-isSuccessful: true
result:
T=Int
P=Int
E=Int
@@ -0,0 +1,5 @@
VARIABLES T P E
SUBTYPE T P
SUBTYPE P E
SUBTYPE E Int
@@ -0,0 +1,26 @@
VARIABLES T P E
SUBTYPE T P
SUBTYPE P E
SUBTYPE Int E
type parameter bounds:
T <: P*, <: E*
P >: T*, <: E*
E >: T*, >: P*, >: Int
status:
-hasCannotCaptureTypesError: false
-hasConflictingConstraints: false
-hasContradiction: false
-hasErrorInConstrainingTypes: false
-hasTypeConstructorMismatch: false
-hasTypeInferenceIncorporationError: false
-hasUnknownParameters: true
-hasViolatedUpperBound: false
-isSuccessful: false
result:
T=???
P=???
E=Int
@@ -0,0 +1,5 @@
VARIABLES T P E
SUBTYPE T P
SUBTYPE P E
SUBTYPE Int E
@@ -0,0 +1,27 @@
VARIABLES T P E
FIX_VARIABLES
SUBTYPE T P
SUBTYPE P E
SUBTYPE Int E
type parameter bounds:
T <: P*, <: E*, <: Int, := Int
P >: T*, <: E*, <: Int, := Int, >: Int
E >: T*, >: P*, >: Int, := Int
status:
-hasCannotCaptureTypesError: false
-hasConflictingConstraints: false
-hasContradiction: false
-hasErrorInConstrainingTypes: false
-hasTypeConstructorMismatch: false
-hasTypeInferenceIncorporationError: false
-hasUnknownParameters: false
-hasViolatedUpperBound: false
-isSuccessful: true
result:
T=Int
P=Int
E=Int
@@ -0,0 +1,6 @@
VARIABLES T P E
FIX_VARIABLES
SUBTYPE T P
SUBTYPE P E
SUBTYPE Int E
@@ -631,6 +631,87 @@ public class ConstraintSystemTestGenerated extends AbstractConstraintSystemTest
}
}
@TestMetadata("compiler/testData/constraintSystem/severalVariables/other")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Other extends AbstractConstraintSystemTest {
public void testAllFilesPresentInOther() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/constraintSystem/severalVariables/other"), Pattern.compile("^(.+)\\.constraints$"), true);
}
@TestMetadata("constraintForNullables.constraints")
public void testConstraintForNullables() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/constraintSystem/severalVariables/other/constraintForNullables.constraints");
doTest(fileName);
}
@TestMetadata("nestedConsumer.constraints")
public void testNestedConsumer() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/constraintSystem/severalVariables/other/nestedConsumer.constraints");
doTest(fileName);
}
@TestMetadata("nestedConsumer1.constraints")
public void testNestedConsumer1() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/constraintSystem/severalVariables/other/nestedConsumer1.constraints");
doTest(fileName);
}
@TestMetadata("nestedInvConsumer.constraints")
public void testNestedInvConsumer() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/constraintSystem/severalVariables/other/nestedInvConsumer.constraints");
doTest(fileName);
}
@TestMetadata("nestedInvProducer.constraints")
public void testNestedInvProducer() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/constraintSystem/severalVariables/other/nestedInvProducer.constraints");
doTest(fileName);
}
@TestMetadata("nestedProducer.constraints")
public void testNestedProducer() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/constraintSystem/severalVariables/other/nestedProducer.constraints");
doTest(fileName);
}
@TestMetadata("nestedProducerAndConsumer.constraints")
public void testNestedProducerAndConsumer() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/constraintSystem/severalVariables/other/nestedProducerAndConsumer.constraints");
doTest(fileName);
}
@TestMetadata("severalOccurrences.constraints")
public void testSeveralOccurrences() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/constraintSystem/severalVariables/other/severalOccurrences.constraints");
doTest(fileName);
}
@TestMetadata("simpleFun.constraints")
public void testSimpleFun() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/constraintSystem/severalVariables/other/simpleFun.constraints");
doTest(fileName);
}
@TestMetadata("simpleThreeVars.constraints")
public void testSimpleThreeVars() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/constraintSystem/severalVariables/other/simpleThreeVars.constraints");
doTest(fileName);
}
@TestMetadata("simpleThreeVarsNoIncorporation.constraints")
public void testSimpleThreeVarsNoIncorporation() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/constraintSystem/severalVariables/other/simpleThreeVarsNoIncorporation.constraints");
doTest(fileName);
}
@TestMetadata("simpleThreeVarsNoIncorporationFixed.constraints")
public void testSimpleThreeVarsNoIncorporationFixed() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/constraintSystem/severalVariables/other/simpleThreeVarsNoIncorporationFixed.constraints");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/constraintSystem/severalVariables/recursive")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)