[Analysis API] Minor, improve naming for 'computeTestDataPath()'

This commit is contained in:
Yan Zhulanow
2024-01-17 00:13:44 +09:00
committed by Space Team
parent d2cfd247a5
commit adb8b7b252
3 changed files with 3 additions and 3 deletions
@@ -72,7 +72,7 @@ object AnalysisApiFe10TestConfigurator : AnalysisApiTestConfigurator() {
JvmResolveUtil.analyze(project, files.filterIsInstance<KtFile>(), compilerConfiguration, packageProviderFactory) JvmResolveUtil.analyze(project, files.filterIsInstance<KtFile>(), compilerConfiguration, packageProviderFactory)
} }
override fun preprocessTestDataPath(path: Path): Path { override fun computeTestDataPath(path: Path): Path {
val newPath = path.resolveSibling(path.nameWithoutExtension + "." + testPrefix + "." + path.extension) val newPath = path.resolveSibling(path.nameWithoutExtension + "." + testPrefix + "." + path.extension)
if (newPath.toFile().exists()) return newPath if (newPath.toFile().exists()) return newPath
return path return path
@@ -293,7 +293,7 @@ abstract class AbstractAnalysisApiBasedTest : TestWithDisposable() {
} }
protected fun runTest(@TestDataFile path: String) { protected fun runTest(@TestDataFile path: String) {
testDataPath = configurator.preprocessTestDataPath(Paths.get(path)) testDataPath = configurator.computeTestDataPath(Paths.get(path))
val testConfiguration = createTestConfiguration() val testConfiguration = createTestConfiguration()
testServices = testConfiguration.testServices testServices = testConfiguration.testServices
val moduleStructure = createModuleStructure(testConfiguration) val moduleStructure = createModuleStructure(testConfiguration)
@@ -42,7 +42,7 @@ abstract class AnalysisApiTestConfigurator {
KotlinGlobalModificationService.getInstance(project).publishGlobalModuleStateModification() KotlinGlobalModificationService.getInstance(project).publishGlobalModuleStateModification()
} }
open fun preprocessTestDataPath(path: Path): Path = path open fun computeTestDataPath(path: Path): Path = path
abstract fun createModules(moduleStructure: TestModuleStructure, testServices: TestServices, project: Project): KtModuleProjectStructure abstract fun createModules(moduleStructure: TestModuleStructure, testServices: TestServices, project: Project): KtModuleProjectStructure