Exemple #1
0
 public void testClassIsTrait() {
   PsiFile psiFile = myFixture.configureByText("foo.kt", "trait Test { }");
   final List<JetDeclaration> declarations = ((JetFile) psiFile).getDeclarations();
   final JetClass jetClass = (JetClass) declarations.get(0);
   final PsiJetClassStub stub = JetStubElementTypes.CLASS.createStub(jetClass, null);
   assertEquals(true, stub.isTrait());
 }
Exemple #2
0
 public void testSuperclassNames() {
   final PsiFile psiFile =
       myFixture.configureByText(
           "foo.kt", "import java.util.ArrayList as alist\nclass C(): alist() { }");
   final List<JetDeclaration> declarations = ((JetFile) psiFile).getDeclarations();
   final JetClass jetClass = (JetClass) declarations.get(0);
   final PsiJetClassStub stub = JetStubElementTypes.CLASS.createStub(jetClass, null);
   final List<String> names = stub.getSuperNames();
   assertSameElements(names, "ArrayList", "alist");
 }