FIR IDE: add more test cases to file FileStructureTest
This commit is contained in:
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
class A {/* NonReanalyzableDeclarationStructureElement */
|
||||
val a = run {
|
||||
class X()
|
||||
|
||||
val y = 10
|
||||
}/* NonReanalyzableDeclarationStructureElement */
|
||||
}
|
||||
|
||||
inline fun <R> run(block: () -> R): R {/* ReanalyzableFunctionStructureElement */
|
||||
return block()
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
enum class A {/* NonReanalyzableDeclarationStructureElement */
|
||||
X,
|
||||
Y,
|
||||
Z
|
||||
|
||||
;
|
||||
|
||||
fun foo(){/* ReanalyzableFunctionStructureElement */}
|
||||
|
||||
val x = 10/* NonReanalyzableDeclarationStructureElement */
|
||||
|
||||
fun bar() = 10/* NonReanalyzableDeclarationStructureElement */
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
enum class A {/* NonReanalyzableDeclarationStructureElement */
|
||||
X {
|
||||
fun localInX() = 1
|
||||
},
|
||||
Y {
|
||||
override fun foo() {}
|
||||
},
|
||||
Z,
|
||||
|
||||
;
|
||||
|
||||
open fun foo() {/* ReanalyzableFunctionStructureElement */}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class A {/* NonReanalyzableDeclarationStructureElement */
|
||||
init {
|
||||
val x = 10
|
||||
class B
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
var x: Int = 10/* ReanalyzablePropertyStructureElement */
|
||||
get() = field
|
||||
set(value) {
|
||||
field = value
|
||||
}
|
||||
|
||||
class X {/* NonReanalyzableDeclarationStructureElement */
|
||||
var y: Int = 10/* ReanalyzablePropertyStructureElement */
|
||||
get() = field
|
||||
set(value) {
|
||||
field = value
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
typealias A = 10/* NonReanalyzableDeclarationStructureElement */
|
||||
+3
@@ -57,6 +57,9 @@ abstract class AbstractFileStructureTest : KotlinLightCodeInsightFixtureTestCase
|
||||
ktDeclaration.parent.addAfter(comment, ktDeclaration)
|
||||
}
|
||||
}
|
||||
is KtTypeAlias -> {
|
||||
ktDeclaration.addAfter(comment, ktDeclaration.getTypeReference())
|
||||
}
|
||||
else -> error("Unsupported declaration $ktDeclaration")
|
||||
}
|
||||
}
|
||||
|
||||
+30
@@ -39,6 +39,26 @@ public class FileStructureTestGenerated extends AbstractFileStructureTest {
|
||||
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/fileStructure/classMemberProperty.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("declarationsInPropertyInit.kt")
|
||||
public void testDeclarationsInPropertyInit() throws Exception {
|
||||
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/fileStructure/declarationsInPropertyInit.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("enumClass.kt")
|
||||
public void testEnumClass() throws Exception {
|
||||
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/fileStructure/enumClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("enumClassWithBody.kt")
|
||||
public void testEnumClassWithBody() throws Exception {
|
||||
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/fileStructure/enumClassWithBody.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("initBlock.kt")
|
||||
public void testInitBlock() throws Exception {
|
||||
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/fileStructure/initBlock.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("localClass.kt")
|
||||
public void testLocalClass() throws Exception {
|
||||
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/fileStructure/localClass.kt");
|
||||
@@ -59,6 +79,11 @@ public class FileStructureTestGenerated extends AbstractFileStructureTest {
|
||||
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/fileStructure/nestedClasses.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propertyAccessors.kt")
|
||||
public void testPropertyAccessors() throws Exception {
|
||||
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/fileStructure/propertyAccessors.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("topLevelExpressionBodyFunWithType.kt")
|
||||
public void testTopLevelExpressionBodyFunWithType() throws Exception {
|
||||
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/fileStructure/topLevelExpressionBodyFunWithType.kt");
|
||||
@@ -83,4 +108,9 @@ public class FileStructureTestGenerated extends AbstractFileStructureTest {
|
||||
public void testTopLevelUnitFun() throws Exception {
|
||||
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/fileStructure/topLevelUnitFun.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("typeAlias.kt")
|
||||
public void testTypeAlias() throws Exception {
|
||||
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/fileStructure/typeAlias.kt");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user