forked from JavaTX/JavaCompilerCore
OverloadingVector Test
This commit is contained in:
parent
dc52dc5dec
commit
0a6aa450db
21
test/plugindevelopment/TypeInsertTests/OverloadingVector.jav
Executable file
21
test/plugindevelopment/TypeInsertTests/OverloadingVector.jav
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
import java.util.Vector;
|
||||||
|
|
||||||
|
class OverloadingVector{
|
||||||
|
|
||||||
|
void method(Vector<String> v) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void method(Vector<Integer> v) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
main(String args) {
|
||||||
|
ol;
|
||||||
|
ol = new OverloadingVector();
|
||||||
|
v;
|
||||||
|
v = new Vector<String> ();
|
||||||
|
ol.method(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package plugindevelopment.TypeInsertTests;
|
||||||
|
|
||||||
|
import de.dhbwstuttgart.typeinference.Menge;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
public class OverloadingVectorTest {
|
||||||
|
private static final String TEST_FILE = "OverloadingVector.jav";
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void run(){
|
||||||
|
Menge<String> mustContain = new Menge<String>();
|
||||||
|
MultipleTypesInsertTester.testSingleInsert(this.TEST_FILE, mustContain);
|
||||||
|
}
|
||||||
|
}
|
@ -864,7 +864,7 @@ public class UnifyTest {
|
|||||||
|
|
||||||
UnifyType gtv = tf.getSimpleType("gtv");
|
UnifyType gtv = tf.getSimpleType("gtv");
|
||||||
UnifyType vector = tf.getSimpleType("Vector", gtv);
|
UnifyType vector = tf.getSimpleType("Vector", gtv);
|
||||||
UnifyType vectorE = tf.getSimpleType("Vector", tphT2);
|
UnifyType vectorT2 = tf.getSimpleType("Vector", tphT2);
|
||||||
UnifyType string = tf.getSimpleType("String");
|
UnifyType string = tf.getSimpleType("String");
|
||||||
UnifyType vectorString = tf.getSimpleType("Vector", string);
|
UnifyType vectorString = tf.getSimpleType("Vector", string);
|
||||||
|
|
||||||
@ -873,8 +873,8 @@ public class UnifyTest {
|
|||||||
IFiniteClosure fc = fcb.getFiniteClosure();
|
IFiniteClosure fc = fcb.getFiniteClosure();
|
||||||
|
|
||||||
Set<UnifyPair> eq = new HashSet<UnifyPair>();
|
Set<UnifyPair> eq = new HashSet<UnifyPair>();
|
||||||
|
eq.add(new UnifyPair(vectorT2, tphT1, PairOperator.SMALLERDOT));
|
||||||
eq.add(new UnifyPair(tphT1, vectorString, PairOperator.SMALLERDOT));
|
eq.add(new UnifyPair(tphT1, vectorString, PairOperator.SMALLERDOT));
|
||||||
eq.add(new UnifyPair(vectorE, tphT1, PairOperator.SMALLERDOT));
|
|
||||||
|
|
||||||
Set<Set<UnifyPair>> actual = new TypeUnify().unifySequential(eq, fc);
|
Set<Set<UnifyPair>> actual = new TypeUnify().unifySequential(eq, fc);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user