Fix incorrectly configured IDE tests
The important changes are in ideaTestUtils.kt: `configureByFiles` must be called on the relative to testData dir path, otherwise java files in the project belong to src/idea/testData/.../A.java instead of src/A.java and can't be found in the root package New updates in resolution when resolving A() call is now asking whether <root>.A exists in PsiPackage::getClasses instead of PsiPackage::findClassByShortName that can find a class even if it's located in the wrong directory
This commit is contained in:
+5
-1
@@ -22,6 +22,8 @@ import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess
|
||||
import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase
|
||||
import org.jetbrains.kotlin.idea.actions.internal.KotlinInternalMode
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
import org.jetbrains.kotlin.test.TestMetadata
|
||||
import kotlin.reflect.full.findAnnotation
|
||||
|
||||
abstract class KotlinLightPlatformCodeInsightFixtureTestCase: LightPlatformCodeInsightFixtureTestCase() {
|
||||
private var kotlinInternalModeOriginalValue: Boolean = false
|
||||
@@ -44,4 +46,6 @@ abstract class KotlinLightPlatformCodeInsightFixtureTestCase: LightPlatformCodeI
|
||||
super.tearDown()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getTestDataPath(): String = this::class.findAnnotation<TestMetadata>()?.value ?: super.getTestDataPath()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user