Skip to content

Commit

Permalink
test: isSubTypeOf doesn't fail (see #2288) on missing type references (
Browse files Browse the repository at this point in the history
  • Loading branch information
monperrus authored and pvojtechovsky committed Sep 16, 2018
1 parent 3c72b5c commit 5f12101
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/test/java/spoon/test/ctType/CtTypeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ public void testIsSubTypeOfonTypeReferences() {
});

assertTrue(count[0] > (9 * 8));

// contract: isSubTypeOf does not throw any exception
// #2288 cannot be reproduced, probably fixed by #2406
CtTypeReference<Object> typeReferenceWithNoDeclaration = launcher.getFactory().createTypeReference();
typeReferenceWithNoDeclaration.setSimpleName("DoesNotExist");
assertFalse(typeReferenceWithNoDeclaration.isSubtypeOf(oCtType.getReference()));
assertFalse(oCtType.isSubtypeOf(typeReferenceWithNoDeclaration));
}

private void checkIsSubtype(CtTypeReference superType, CtTypeReference subType, Map<String, CtTypeReference<?>> nameToTypeRef) {
Expand Down

0 comments on commit 5f12101

Please sign in to comment.