Fix test case

This commit is contained in:
Victorious3 2023-04-04 13:09:05 +02:00
parent e55b9938dc
commit aa9782edd7

View File

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