Minor. Reformat AbstractForeignAnnotationsTest.kt
This commit is contained in:
committed by
Victor Petukhov
parent
90a9ca6cb3
commit
ce2b7bded6
+19
-13
@@ -40,16 +40,16 @@ abstract class AbstractForeignAnnotationsTest : AbstractDiagnosticsTest() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected fun compileTestAnnotations(extraClassPath: List<File>): List<File> =
|
protected fun compileTestAnnotations(extraClassPath: List<File>): List<File> =
|
||||||
listOf(MockLibraryUtil.compileJavaFilesLibraryToJar(
|
listOf(MockLibraryUtil.compileJavaFilesLibraryToJar(
|
||||||
TEST_ANNOTATIONS_SOURCE_PATH,
|
TEST_ANNOTATIONS_SOURCE_PATH,
|
||||||
"test-foreign-annotations",
|
"test-foreign-annotations",
|
||||||
extraOptions = listOf("-Xallow-kotlin-package"),
|
extraOptions = listOf("-Xallow-kotlin-package"),
|
||||||
extraClasspath = extraClassPath.map { it.path }
|
extraClasspath = extraClassPath.map { it.path }
|
||||||
))
|
))
|
||||||
|
|
||||||
protected fun createJarWithForeignAnnotations(): List<File> = listOf(
|
protected fun createJarWithForeignAnnotations(): List<File> = listOf(
|
||||||
MockLibraryUtil.compileJavaFilesLibraryToJar(annotationsPath, "foreign-annotations"),
|
MockLibraryUtil.compileJavaFilesLibraryToJar(annotationsPath, "foreign-annotations"),
|
||||||
ForTestCompileRuntime.jvmAnnotationsForTests()
|
ForTestCompileRuntime.jvmAnnotationsForTests()
|
||||||
)
|
)
|
||||||
|
|
||||||
open protected val annotationsPath: String
|
open protected val annotationsPath: String
|
||||||
@@ -58,10 +58,10 @@ abstract class AbstractForeignAnnotationsTest : AbstractDiagnosticsTest() {
|
|||||||
override fun loadLanguageVersionSettings(module: List<TestFile>): LanguageVersionSettings {
|
override fun loadLanguageVersionSettings(module: List<TestFile>): LanguageVersionSettings {
|
||||||
val analysisFlags = loadAnalysisFlags(module)
|
val analysisFlags = loadAnalysisFlags(module)
|
||||||
return CompilerTestLanguageVersionSettings(
|
return CompilerTestLanguageVersionSettings(
|
||||||
DEFAULT_DIAGNOSTIC_TESTS_FEATURES,
|
DEFAULT_DIAGNOSTIC_TESTS_FEATURES,
|
||||||
ApiVersion.LATEST_STABLE,
|
ApiVersion.LATEST_STABLE,
|
||||||
LanguageVersion.LATEST_STABLE,
|
LanguageVersion.LATEST_STABLE,
|
||||||
analysisFlags = analysisFlags
|
analysisFlags = analysisFlags
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,10 +78,16 @@ abstract class AbstractForeignAnnotationsTest : AbstractDiagnosticsTest() {
|
|||||||
name to state
|
name to state
|
||||||
}.toMap()
|
}.toMap()
|
||||||
|
|
||||||
return mapOf(JvmAnalysisFlags.javaTypeEnhancementState to JavaTypeEnhancementState(globalState, migrationState, userAnnotationsState))
|
return mapOf(
|
||||||
|
JvmAnalysisFlags.javaTypeEnhancementState to JavaTypeEnhancementState(
|
||||||
|
globalState,
|
||||||
|
migrationState,
|
||||||
|
userAnnotationsState
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun List<TestFile>.getDirectiveValue(directive: String): ReportLevel? = mapNotNull {
|
private fun List<TestFile>.getDirectiveValue(directive: String): ReportLevel? = mapNotNull {
|
||||||
InTextDirectivesUtils.findLinesWithPrefixesRemoved(it.expectedText, directive).firstOrNull()
|
InTextDirectivesUtils.findLinesWithPrefixesRemoved(it.expectedText, directive).firstOrNull()
|
||||||
}.firstOrNull().let { ReportLevel.findByDescription(it) }
|
}.firstOrNull().let { ReportLevel.findByDescription(it) }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user