Skip to content

Commit

Permalink
test(refactor): remove commented code from tests (#2297)
Browse files Browse the repository at this point in the history
* refactor: remove commented code

* refactor: remove comment - it is fixed in #1416

* refactor: remove commented code

* fix typo

* restore deleted assertion
  • Loading branch information
zielint0 authored and surli committed Jul 30, 2018
1 parent f499611 commit 93a89b8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
6 changes: 1 addition & 5 deletions src/test/java/spoon/test/exceptions/ExceptionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@ public void testUnionCatchExceptionInsideLambdaInNoClasspath() {
CtCatchVariable variable2 = catches.get(1).getParameter(); // outside the lambda

assertEquals(variable1.getMultiTypes(), variable2.getMultiTypes());

// for now the type of CtCatchVariable is not the same
// this should be fix in the future (see: https://github.com/INRIA/spoon/issues/1420)
//assertEquals(variable2, variable1);
assertEquals(variable2, variable1);
}

}
3 changes: 1 addition & 2 deletions src/test/java/spoon/test/generics/GenericsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -659,15 +659,14 @@ public void testGenericTypeReference() throws Exception {

CtType<Tacos> aTacos = buildNoClasspath(Tacos.class).Type().get(Tacos.class);
//this returns a type reference with uninitialized actual type arguments.
// CtTypeReference<?> genericTypeRef = aTacos.getReference();
CtTypeReference<?> genericTypeRef = aTacos.getFactory().Type().createReference(aTacos, true);

assertTrue(genericTypeRef.getActualTypeArguments().size()>0);
assertEquals(aTacos.getFormalCtTypeParameters().size(), genericTypeRef.getActualTypeArguments().size());
for(int i=0; i<aTacos.getFormalCtTypeParameters().size(); i++) {
assertSame("TypeParameter reference idx="+i+" is different", aTacos.getFormalCtTypeParameters().get(i), genericTypeRef.getActualTypeArguments().get(i).getTypeParameterDeclaration());

// contract: getTypeParameterDeclaration goes back to the declaration, eevn without context
// contract: getTypeParameterDeclaration goes back to the declaration, even without context
assertSame(aTacos.getFormalCtTypeParameters().get(i), genericTypeRef.getActualTypeArguments().get(i).getTypeParameterDeclaration());

}
Expand Down
5 changes: 0 additions & 5 deletions src/test/java/spoon/test/replace/ReplaceParametrizedTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,6 @@ public void scan(CtRole role, CtElement e) {
found = true;
return;
}
// if (rh.getRole()==CtRole.TYPE && role == CtRole.MULTI_TYPE) {
// //CtCatchVaraible#type sets CtCatchVaraible#multiType - OK
// found = true;
// return;
// }
problems.add("Argument was set into " + rh.getRole() + " but was found in " + role);
}
}
Expand Down

0 comments on commit 93a89b8

Please sign in to comment.