Add tests for companion objects and various kinds of classes

(no representation for enum entries yet).
This commit is contained in:
Dmitry Petrov
2016-08-30 11:16:25 +03:00
committed by Dmitry Petrov
parent a6bee7a22b
commit 7adf173a66
5 changed files with 56 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
class TestClass
interface TestInterface
object TestObject
annotation class TestAnnotationClass
enum class TestEnumClass
+14
View File
@@ -0,0 +1,14 @@
FILE /classes.kt
CLASS CLASS TestClass
FUN public constructor TestClass()
BLOCK_BODY
CLASS INTERFACE TestInterface
CLASS OBJECT TestObject
FUN private constructor TestObject()
BLOCK_BODY
CLASS ANNOTATION_CLASS TestAnnotationClass
FUN public constructor TestAnnotationClass()
BLOCK_BODY
CLASS ENUM_CLASS TestEnumClass
FUN private constructor TestEnumClass()
BLOCK_BODY
@@ -0,0 +1,8 @@
class Test1 {
companion object
}
class Test2 {
companion object Named
}
+13
View File
@@ -0,0 +1,13 @@
FILE /companionObject.kt
CLASS CLASS Test1
FUN public constructor Test1()
BLOCK_BODY
CLASS OBJECT Companion
FUN private constructor Companion()
BLOCK_BODY
CLASS CLASS Test2
FUN public constructor Test2()
BLOCK_BODY
CLASS OBJECT Named
FUN private constructor Named()
BLOCK_BODY
@@ -55,6 +55,18 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
doTest(fileName);
}
@TestMetadata("classes.kt")
public void testClasses() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/classes/classes.kt");
doTest(fileName);
}
@TestMetadata("companionObject.kt")
public void testCompanionObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/classes/companionObject.kt");
doTest(fileName);
}
@TestMetadata("delegatingConstructorCallsInSecondaryConstructors.kt")
public void testDelegatingConstructorCallsInSecondaryConstructors() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/classes/delegatingConstructorCallsInSecondaryConstructors.kt");