From de607cfd53c332a00e13dc88f81f8254161795bb Mon Sep 17 00:00:00 2001 From: Florian Steurer Date: Mon, 28 Mar 2016 01:19:57 +0200 Subject: [PATCH] noch ein smaller test --- test/unify/FiniteClosureTest.java | 37 ++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/test/unify/FiniteClosureTest.java b/test/unify/FiniteClosureTest.java index a8a72273..7c422bda 100644 --- a/test/unify/FiniteClosureTest.java +++ b/test/unify/FiniteClosureTest.java @@ -340,17 +340,44 @@ public class FiniteClosureTest { /* * Test Case 14 * - * MyMap> <* HashMap + * MyMap <* TreeMap> * - * smaller(HashMap) = + * smaller(TreeMap) = + * { TreeMap, List>, + * TreeMap>, + * TreeMap>, + * TreeMap>, + * MyMap + * MyMap + * MyMap + * MyMap */ + Type listExtNum = tf.getSimpleType("List", extNum); + Type treeMapExtNumListExtNum = tf.getSimpleType("TreeMap", extNum, listExtNum); + Type myMapInt = tf.getSimpleType("MyMap", integer); + Type myMapNumber = tf.getSimpleType("MyMap", number); + Type myMapExtInt = tf.getSimpleType("MyMap", extInt); + Type myMapExtNum = tf.getSimpleType("MyMap", extNum); + + actual = fc.smaller(treeMapExtNumListExtNum); + + expectedResult = new HashSet<>(Arrays.stream(new Type[] { + tf.getSimpleType("TreeMap", extNum, listExtNum), + tf.getSimpleType("TreeMap", extInt, listExtNum), + tf.getSimpleType("TreeMap", number, listExtNum), + tf.getSimpleType("TreeMap", integer, listExtNum), + myMapInt, myMapNumber, myMapExtInt, myMapExtNum + }).collect(Collectors.toSet())); + + Assert.assertEquals(expectedResult, actual); + /* * Test Case 15: * - * MyMap> <* HashMap -// * TODO sinnvoll ausformulieren - * smaller(HashMap) = + * MyMap <* HashMap> + * + * smaller(SortedSet) = * { HashMap, List>, * HashMap>, * MyMap> }