Merge mit refactoring

This commit is contained in:
JanUlrich 2016-04-01 18:24:36 +02:00
parent a3e7b4567a
commit 1bf208b833

View File

@ -11,7 +11,7 @@ import org.junit.Test;
import de.dhbwstuttgart.typeinference.unify.interfaces.IFiniteClosure; import de.dhbwstuttgart.typeinference.unify.interfaces.IFiniteClosure;
import de.dhbwstuttgart.typeinference.unify.model.MPair; import de.dhbwstuttgart.typeinference.unify.model.MPair;
import de.dhbwstuttgart.typeinference.unify.model.MPair.PairOperator; import de.dhbwstuttgart.typeinference.unify.model.PairOperator;
import de.dhbwstuttgart.typeinference.unify.model.FiniteClosure; import de.dhbwstuttgart.typeinference.unify.model.FiniteClosure;
import de.dhbwstuttgart.typeinference.unify.model.UnifyType; import de.dhbwstuttgart.typeinference.unify.model.UnifyType;
@ -103,31 +103,15 @@ public class FiniteClosureTest {
* smaller(Set<T>) = * smaller(Set<T>) =
* { HashSet<T>, Set<T>, TreeSet<T>, LinkedHashSet<T> } * { HashSet<T>, Set<T>, TreeSet<T>, LinkedHashSet<T> }
*/ */
<<<<<<< HEAD
UnifyType t = tf.getPlaceholderType("T"); UnifyType t = tf.getPlaceholderType("T");
UnifyType setT = tf.getSimpleType("Set", t); UnifyType setT = tf.getSimpleType("Set", t);
UnifyType hashSetT = tf.getSimpleType("HashSet", t); UnifyType hashSetT = tf.getSimpleType("HashSet", t);
UnifyType treeSetT = tf.getSimpleType("TreeSet", t); UnifyType treeSetT = tf.getSimpleType("TreeSet", t);
UnifyType linkedHashSetT = tf.getSimpleType("LinkedHashSet", t); UnifyType linkedHashSetT = tf.getSimpleType("LinkedHashSet", t);
UnifyType hashSetExtT = tf.getSimpleType("HashSet", t);
UnifyType treeSetExtT = tf.getSimpleType("TreeSet", t);
UnifyType linkedHashSetExtT = tf.getSimpleType("LinkedHashSet", t);
UnifyType setExtT = tf.getSimpleType("Set", t);
expectedResult = new HashSet<>(Arrays.stream(new UnifyType[] { expectedResult = new HashSet<>(Arrays.stream(new UnifyType[] {
setT, hashSetT, treeSetT, linkedHashSetT, setT, hashSetT, treeSetT, linkedHashSetT
setExtT, hashSetExtT, treeSetExtT, linkedHashSetExtT
=======
Type t = tf.getPlaceholderType("T");
Type setT = tf.getSimpleType("Set", t);
Type hashSetT = tf.getSimpleType("HashSet", t);
Type treeSetT = tf.getSimpleType("TreeSet", t);
Type linkedHashSetT = tf.getSimpleType("LinkedHashSet", t);
expectedResult = new HashSet<>(Arrays.stream(new Type[] {
setT, hashSetT, treeSetT, linkedHashSetT
>>>>>>> d89d06797e17a7a95f007fe24e9b6133b3b13179
}).collect(Collectors.toSet())); }).collect(Collectors.toSet()));
Assert.assertEquals(expectedResult, fc.smaller(setT)); Assert.assertEquals(expectedResult, fc.smaller(setT));
@ -169,27 +153,20 @@ public class FiniteClosureTest {
* { HashSet<T1>, Set<T1>, TreeSet<T1>, LinkedHashSet<T1>, * { HashSet<T1>, Set<T1>, TreeSet<T1>, LinkedHashSet<T1>,
* HashSet<? ext T1>, Set<? ext T1>, TreeSet<? ext T1>, LinkedHashSet<? ext T1> } * HashSet<? ext T1>, Set<? ext T1>, TreeSet<? ext T1>, LinkedHashSet<? ext T1> }
* *
*/ */
<<<<<<< HEAD UnifyType t1 = tf.getPlaceholderType("T1");
UnifyType extT1 = tf.getExtendsType(t1);
UnifyType setExtT1 = tf.getSimpleType("Set", extT1);
UnifyType hashSetExtT1 = tf.getSimpleType("HashSet", extT1);
UnifyType treeSetExtT1 = tf.getSimpleType("TreeSet", extT1);
UnifyType linkedHashSetExtT1 = tf.getSimpleType("LinkedHashSet", extT1);
UnifyType setT1 = tf.getSimpleType("Set", t1);
UnifyType hashSetT1 = tf.getSimpleType("HashSet", t1);
UnifyType treeSetT1 = tf.getSimpleType("TreeSet", t1);
UnifyType linkedHashSetT1 = tf.getSimpleType("LinkedHashSet", t1);
expectedResult = new HashSet<>(Arrays.stream(new UnifyType[] { expectedResult = new HashSet<>(Arrays.stream(new UnifyType[] {
setT, hashSetT, treeSetT, linkedHashSetT,
setExtT, hashSetExtT, treeSetExtT, linkedHashSetExtT
=======
Type t1 = tf.getPlaceholderType("T1");
Type extT1 = tf.getExtendsType(t1);
Type setExtT1 = tf.getSimpleType("Set", extT1);
Type hashSetExtT1 = tf.getSimpleType("HashSet", extT1);
Type treeSetExtT1 = tf.getSimpleType("TreeSet", extT1);
Type linkedHashSetExtT1 = tf.getSimpleType("LinkedHashSet", extT1);
Type setT1 = tf.getSimpleType("Set", t1);
Type hashSetT1 = tf.getSimpleType("HashSet", t1);
Type treeSetT1 = tf.getSimpleType("TreeSet", t1);
Type linkedHashSetT1 = tf.getSimpleType("LinkedHashSet", t1);
expectedResult = new HashSet<>(Arrays.stream(new Type[] {
setT1, hashSetT1, treeSetT1, linkedHashSetT1, setT1, hashSetT1, treeSetT1, linkedHashSetT1,
setExtT1, hashSetExtT1, treeSetExtT1, linkedHashSetExtT1 setExtT1, hashSetExtT1, treeSetExtT1, linkedHashSetExtT1
>>>>>>> d89d06797e17a7a95f007fe24e9b6133b3b13179
}).collect(Collectors.toSet())); }).collect(Collectors.toSet()));
Assert.assertEquals(expectedResult, fc.smaller(setExtT1)); Assert.assertEquals(expectedResult, fc.smaller(setExtT1));