FIR IDE: add more test cases to TraversalCounterTestGenerated

This commit is contained in:
Ilya Kirillov
2021-04-09 11:40:54 +02:00
parent e78e8f8c79
commit 5829f1a6e7
10 changed files with 146 additions and 0 deletions
@@ -0,0 +1,11 @@
class A {
val a = run {
class X()
val y = 10
}
}
inline fun <R> run(block: () -> R): R {
return block()
}
@@ -0,0 +1,13 @@
enum class A {
X,
Y,
Z
;
fun foo(){}
val x = 10
fun bar() = 10
}
@@ -0,0 +1,13 @@
enum class A {
X {
fun localInX() = 1
},
Y {
override fun foo() {}
},
Z,
;
open fun foo() {}
}
@@ -0,0 +1,6 @@
class A {
init {
val x = 10
class B
}
}
@@ -0,0 +1,32 @@
class Outer {
val i: Int = 1
get() {
class Inner {
var i: Int = 2
get() {
field++
return field
}
val j: Int = 3
get() {
field = 42
return field
}
fun innerMember() {
field++
}
}
return field
}
val j: Int = 4
get() {
fun local() {
field++
field++
}
local()
return field
}
}
@@ -0,0 +1,3 @@
class A {
typealias X = Int
}
@@ -0,0 +1,7 @@
class A {
fun y() {}
class B {
fun x() {}
}
}
@@ -0,0 +1,15 @@
var x: Int = 10
get() = field
set(value) {
println(1)
field = value
}
class X {
var y: Int = 10
get() = field
set(value) {
println(2)
field = value
}
}
@@ -0,0 +1 @@
typealias A = 10
@@ -34,11 +34,36 @@ public class DiagnosticTraversalCounterTestGenerated extends AbstractDiagnosticT
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/diagnosticTraversalCounter/constructor.kt");
}
@TestMetadata("declarationsInPropertyInit.kt")
public void testDeclarationsInPropertyInit() throws Exception {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/diagnosticTraversalCounter/declarationsInPropertyInit.kt");
}
@TestMetadata("enumClass.kt")
public void testEnumClass() throws Exception {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/diagnosticTraversalCounter/enumClass.kt");
}
@TestMetadata("enumClassWithBody.kt")
public void testEnumClassWithBody() throws Exception {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/diagnosticTraversalCounter/enumClassWithBody.kt");
}
@TestMetadata("functionalType.kt")
public void testFunctionalType() throws Exception {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/diagnosticTraversalCounter/functionalType.kt");
}
@TestMetadata("initBlock.kt")
public void testInitBlock() throws Exception {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/diagnosticTraversalCounter/initBlock.kt");
}
@TestMetadata("localDeclarationsInAccessor.kt")
public void testLocalDeclarationsInAccessor() throws Exception {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/diagnosticTraversalCounter/localDeclarationsInAccessor.kt");
}
@TestMetadata("localFunctionWithImplicitType.kt")
public void testLocalFunctionWithImplicitType() throws Exception {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/diagnosticTraversalCounter/localFunctionWithImplicitType.kt");
@@ -59,6 +84,11 @@ public class DiagnosticTraversalCounterTestGenerated extends AbstractDiagnosticT
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/diagnosticTraversalCounter/memberProperties.kt");
}
@TestMetadata("memberTypeAlias.kt")
public void testMemberTypeAlias() throws Exception {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/diagnosticTraversalCounter/memberTypeAlias.kt");
}
@TestMetadata("multipleTopLevelClasses.kt")
public void testMultipleTopLevelClasses() throws Exception {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/diagnosticTraversalCounter/multipleTopLevelClasses.kt");
@@ -79,6 +109,16 @@ public class DiagnosticTraversalCounterTestGenerated extends AbstractDiagnosticT
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/diagnosticTraversalCounter/nestedClases.kt");
}
@TestMetadata("nestedClasesWithFun.kt")
public void testNestedClasesWithFun() throws Exception {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/diagnosticTraversalCounter/nestedClasesWithFun.kt");
}
@TestMetadata("propertyAccessors.kt")
public void testPropertyAccessors() throws Exception {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/diagnosticTraversalCounter/propertyAccessors.kt");
}
@TestMetadata("propertyWithGetterAndSetter.kt")
public void testPropertyWithGetterAndSetter() throws Exception {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/diagnosticTraversalCounter/propertyWithGetterAndSetter.kt");
@@ -88,4 +128,9 @@ public class DiagnosticTraversalCounterTestGenerated extends AbstractDiagnosticT
public void testSecondaryConstructor() throws Exception {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/diagnosticTraversalCounter/secondaryConstructor.kt");
}
@TestMetadata("typeAlias.kt")
public void testTypeAlias() throws Exception {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/diagnosticTraversalCounter/typeAlias.kt");
}
}