OverloadingVector Test

This commit is contained in:
JanUlrich 2016-05-03 13:03:14 +02:00
parent dc52dc5dec
commit 0a6aa450db
3 changed files with 38 additions and 2 deletions

View 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);
}
}

View File

@ -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);
}
}

View File

@ -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);