AA: rename test api for better clarification
Many sub tests are implementing the same name, doTestByFileStructure, which indeed are based on the list of KtFile in a single module. Rather, this one should be named after "ModuleStructure".
This commit is contained in:
committed by
Ilya Kirillov
parent
96e789098f
commit
5bca3c6841
+1
-1
@@ -12,7 +12,7 @@ import org.jetbrains.kotlin.test.services.TestModuleStructure
|
||||
import org.jetbrains.kotlin.test.services.TestServices
|
||||
|
||||
abstract class AbstractAnalysisApiBasedSingleModuleTest : AbstractAnalysisApiBasedTest() {
|
||||
final override fun doTestByFileStructure(moduleStructure: TestModuleStructure, testServices: TestServices) {
|
||||
final override fun doTestByModuleStructure(moduleStructure: TestModuleStructure, testServices: TestServices) {
|
||||
val singleModule = moduleStructure.modules.single()
|
||||
val ktFiles = testServices.ktModuleProvider.getModuleFiles(singleModule).filterIsInstance<KtFile>()
|
||||
doTestByFileStructure(ktFiles, singleModule, testServices)
|
||||
|
||||
+2
-3
@@ -17,7 +17,6 @@ import org.jetbrains.kotlin.analysis.test.framework.TestWithDisposable
|
||||
import org.jetbrains.kotlin.analysis.test.framework.project.structure.ktModuleProvider
|
||||
import org.jetbrains.kotlin.analysis.test.framework.services.ExpressionMarkerProvider
|
||||
import org.jetbrains.kotlin.analysis.test.framework.services.ExpressionMarkersSourceFilePreprocessor
|
||||
import org.jetbrains.kotlin.analysis.test.framework.services.SubstitutionParser
|
||||
import org.jetbrains.kotlin.analysis.test.framework.services.libraries.CompilerExecutor
|
||||
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfigurator
|
||||
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendKind
|
||||
@@ -57,7 +56,7 @@ abstract class AbstractAnalysisApiBasedTest : TestWithDisposable() {
|
||||
configurator.configureTest(builder, disposable)
|
||||
}
|
||||
|
||||
protected abstract fun doTestByFileStructure(moduleStructure: TestModuleStructure, testServices: TestServices)
|
||||
protected abstract fun doTestByModuleStructure(moduleStructure: TestModuleStructure, testServices: TestServices)
|
||||
|
||||
protected fun AssertionsService.assertEqualsToTestDataFileSibling(actual: String, extension: String = ".txt") {
|
||||
val testPrefix = configurator.testPrefix
|
||||
@@ -141,7 +140,7 @@ abstract class AbstractAnalysisApiBasedTest : TestWithDisposable() {
|
||||
return
|
||||
}
|
||||
|
||||
doTestByFileStructure(moduleStructure, testServices)
|
||||
doTestByModuleStructure(moduleStructure, testServices)
|
||||
}
|
||||
|
||||
private fun createTestConfiguration(): TestConfiguration {
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import org.jetbrains.kotlin.test.services.TestModuleStructure
|
||||
import org.jetbrains.kotlin.test.services.TestServices
|
||||
|
||||
abstract class AbstractLowLevelApiSingleFileTest : AbstractLowLevelApiSingleModuleTest() {
|
||||
final override fun doTestByFileStructure(moduleStructure: TestModuleStructure, testServices: TestServices) {
|
||||
final override fun doTestByModuleStructure(moduleStructure: TestModuleStructure, testServices: TestServices) {
|
||||
val singleModule = moduleStructure.modules.single()
|
||||
val singleFile = testServices.ktModuleProvider.getModuleFiles(singleModule).filterIsInstance<KtFile>().single()
|
||||
doTestByFileStructure(singleFile, moduleStructure, testServices)
|
||||
|
||||
Reference in New Issue
Block a user