[Analysis API] Remove test infrastructure for obsolete on-air analysis
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
// FILE: B.kt
|
||||
class A<caret_onAirContext>K: A<String>() {
|
||||
class AK: A<String>() {
|
||||
}
|
||||
// FILE: A.java
|
||||
class A<T> {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// FILE: B.kt
|
||||
interface B: A {
|
||||
fun f<caret_onAirContext>oo(): java.util.List<String?>?
|
||||
fun foo(): java.util.List<String?>?
|
||||
}
|
||||
// FILE: A.java
|
||||
public interface A {
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// FILE: B.kt
|
||||
class B: A<String> {
|
||||
override fun <K : String?> f<caret_onAirContext>oo(): K? {
|
||||
override fun <K : String?> foo(): K? {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// FILE: B.kt
|
||||
interface B: A {
|
||||
fun fo<caret_onAirContext>o(): java.util.List<String?>?
|
||||
fun foo(): java.util.List<String?>?
|
||||
}
|
||||
// FILE: A.java
|
||||
public interface A {
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// FILE: B.kt
|
||||
interface B: A {
|
||||
fun f<caret_onAirContext>oo(): String?
|
||||
fun foo(): String?
|
||||
}
|
||||
// FILE: A.java
|
||||
public interface A {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// FILE: B.kt
|
||||
interface B: A {
|
||||
fun fo<caret_onAirContext>o(): Int
|
||||
fun foo(): Int
|
||||
}
|
||||
// FILE: A.java
|
||||
public interface A {
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// FILE: B.kt
|
||||
interface B: A<String> {
|
||||
fun f<caret_onAirContext>oo(): String?
|
||||
fun foo(): String?
|
||||
}
|
||||
// FILE: A.java
|
||||
public interface A<T> {
|
||||
|
||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
// FILE: B.kt
|
||||
class AK: A<String>() {
|
||||
inner class BK: B<String>() {
|
||||
override fun <K : String?> f<caret_onAirContext>oo(): K {
|
||||
override fun <K : String?> foo(): K {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -33,6 +33,6 @@ package main
|
||||
import rex1.*
|
||||
import rex2.*
|
||||
|
||||
object <caret_onAirContext>MainObject : RexClass1, RexClass2 {
|
||||
object MainObject : RexClass1, RexClass2 {
|
||||
fun foo(): List<Any> = listOf(rexCallable1(), rexCallable2())
|
||||
}
|
||||
+1
-1
@@ -41,4 +41,4 @@ package generated
|
||||
open class GenClass2
|
||||
|
||||
// FILE: main.kt
|
||||
fun <caret_onAirContext>main() {}
|
||||
fun main() {}
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
import c.b
|
||||
|
||||
val a<caret_onAirContext> = 5
|
||||
val a = 5
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
// FILE: main.kt
|
||||
import other.A as AAA
|
||||
|
||||
val a<caret_onAirContext> = 5
|
||||
val a = 5
|
||||
|
||||
// FILE: other/other.kt
|
||||
package other
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
// RENDER_DEFAULT_IMPORTING_SCOPE
|
||||
|
||||
val a<caret_onAirContext> = 5
|
||||
val a = 5
|
||||
|
||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
// FILE: main.kt
|
||||
import other.A
|
||||
|
||||
val a<caret_onAirContext> = 5
|
||||
val a = 5
|
||||
|
||||
// FILE: other/other.kt
|
||||
package other
|
||||
|
||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
// FILE: main.kt
|
||||
import other.*
|
||||
|
||||
val a<caret_onAirContext> = 5
|
||||
val a = 5
|
||||
|
||||
// FILE: other/other.kt
|
||||
package other
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
class J: JavaClass<String> {}
|
||||
|
||||
fun some(j: J) {
|
||||
j.f<caret>o<caret_onAirContext>o()
|
||||
j.f<caret>oo()
|
||||
}
|
||||
|
||||
// FILE: JavaClass.java
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
class J: JavaClass<String> {}
|
||||
|
||||
fun some(j: J) {
|
||||
j.f<caret>o<caret_onAirContext>o()
|
||||
j.f<caret>oo()
|
||||
}
|
||||
|
||||
// FILE: JavaClass.java
|
||||
|
||||
-19
@@ -26,7 +26,6 @@ import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendK
|
||||
import org.jetbrains.kotlin.analysis.test.framework.utils.SkipTestException
|
||||
import org.jetbrains.kotlin.analysis.test.framework.utils.singleOrZeroValue
|
||||
import org.jetbrains.kotlin.platform.jvm.JvmPlatforms
|
||||
import org.jetbrains.kotlin.psi.KtDeclaration
|
||||
import org.jetbrains.kotlin.psi.KtElement
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.test.TestConfiguration
|
||||
@@ -379,20 +378,6 @@ abstract class AbstractAnalysisApiBasedTest : TestWithDisposable() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoke the analysis in the context of given [file]
|
||||
*
|
||||
* To perform the test for in-air analysis, it will look for the declaration marked with the caret `<caret_onAirContext>`
|
||||
*/
|
||||
protected fun <R> analyseForTest(file: KtFile, action: KtAnalysisSession.(KtElement) -> R): R {
|
||||
return if (configurator.analyseInDependentSession) {
|
||||
val declaration = testServices.expressionMarkerProvider.getElementOfTypeAtCaret<KtDeclaration>(file, ON_AIR_CONTEXT_CARET_TAG)
|
||||
analyseForTest(declaration, action)
|
||||
} else {
|
||||
analyze(file, action = { action(file) })
|
||||
}
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
fun initTestInfo(testInfo: TestInfo) {
|
||||
this.testInfo = KotlinTestInfo(
|
||||
@@ -401,8 +386,4 @@ abstract class AbstractAnalysisApiBasedTest : TestWithDisposable() {
|
||||
tags = testInfo.tags
|
||||
)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val ON_AIR_CONTEXT_CARET_TAG = "onAirContext"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user