diff --git a/src/test/java/targetast/TestGenerics.java b/src/test/java/targetast/TestGenerics.java index 23c8b1524..f6308861a 100644 --- a/src/test/java/targetast/TestGenerics.java +++ b/src/test/java/targetast/TestGenerics.java @@ -158,33 +158,30 @@ public class TestGenerics { var generics = result.genericsResults.get(0); assertEquals(1, generics.get(result.clazz).size()); - assertEquals(3, generics.get(id).size()); + assertEquals(2, generics.get(id).size()); assertEquals(2, generics.get(m).size()); assertEquals(3, generics.get(main).size()); - var M = generics.getBounds(a.getType(), result.clazz); - assertEquals(M, new BoundsList(new Bound(false, ASTToTargetAST.OBJECT))); + var N = generics.getBounds(a.getType(), result.clazz); + assertEquals(N, new BoundsList(new Bound(false, ASTToTargetAST.OBJECT))); - var O = generics.getBounds(id.getParameterList().getParameterAt(0).getType(), result.clazz, id); - var OChain = new BoundsList(new Bound(true, TypePlaceholder.of("P")), new Bound(true, ASTToTargetAST.OBJECT)); - assertEquals(O, OChain); - var AK = generics.getBounds(id.getReturnType(), result.clazz, id); - var AKChain = new BoundsList(new Bound(true, ASTToTargetAST.OBJECT)); - assertEquals(AK, AKChain); + var P = generics.getBounds(id.getParameterList().getParameterAt(0).getType(), result.clazz, id); + var O = generics.getBounds(id.getReturnType(), result.clazz, id); + assertEquals(P, O); + assertEquals(O, new BoundsList(new Bound(true, ASTToTargetAST.OBJECT))); - // TODO Shouldn't AK and AK2 be the same and on the class? - var AK2 = generics.getBounds(m.getParameterList().getParameterAt(0).getType(), result.clazz, m); - var Y = generics.getBounds(m.getParameterList().getParameterAt(0).getType(), result.clazz, m); - assertEquals(AK2, AKChain); - assertEquals(Y, AKChain); + assertEquals(generics.resolve(m.getParameterList().getParameterAt(0).getType()), generics.resolve(m.getReturnType())); + var Y = generics.getBounds(m.getParameterList().getParameterAt(0).getType(), result.clazz, m); + var AA = generics.getBounds(m.getParameterList().getParameterAt(1).getType(), result.clazz, m); + assertEquals(Y, AA); + assertEquals(AA, new BoundsList(new Bound(true, ASTToTargetAST.OBJECT))); - var AF = generics.getBounds(main.getParameterList().getParameterAt(0).getType(), result.clazz, main); - var AG= generics.getBounds(main.getParameterList().getParameterAt(1).getType(), result.clazz, main); - var AK3 = generics.getBounds(main.getReturnType(), result.clazz, main); - var AFChain = new BoundsList(new Bound(true, TypePlaceholder.of("AG")), new Bound(true, ASTToTargetAST.OBJECT)); - assertEquals(AF, AFChain); - assertEquals(AG, AKChain); - assertEquals(AK3, AKChain); + var AI = generics.getBounds(m.getParameterList().getParameterAt(0).getType(), result.clazz, m); + var AJ = generics.getBounds(m.getParameterList().getParameterAt(1).getType(), result.clazz, m); + var AH = generics.getBounds(m.getReturnType(), result.clazz, m); + assertEquals(AI, AJ); + assertEquals(AJ, AH); + assertEquals(AH, new BoundsList(new Bound(true, ASTToTargetAST.OBJECT))); } @Test