diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/JspecifyDiagnosticComplianceHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/JspecifyDiagnosticComplianceHandler.kt index c6f3eae9478..e10fc01278d 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/JspecifyDiagnosticComplianceHandler.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/JspecifyDiagnosticComplianceHandler.kt @@ -30,7 +30,7 @@ class JspecifyDiagnosticComplianceHandler(testServices: TestServices) : ClassicF val jspecifyMark = diagnosticsToJspecifyMarks.getValue(jspecifyMode)[metaInfo.diagnostic.factory] ?: continue val fileLines = ktFile.text.lines() val fileLinePositions = - fileLines.map { it.length }.runningReduce { sumLength, length -> sumLength + length + System.lineSeparator().length } + fileLines.map { it.length }.runningReduce { sumLength, length -> sumLength + length + 1 } val lineIndexToPasteJspecifyMark = fileLinePositions.indexOfLast { it < metaInfo.start } val positionToPasteJspecifyMark = fileLinePositions[lineIndexToPasteJspecifyMark] val offset = fileLines[lineIndexToPasteJspecifyMark + 1].takeWhile { it == ' ' }.length diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/preprocessors/JspecifyMarksCleanupPreprocessor.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/preprocessors/JspecifyMarksCleanupPreprocessor.kt index e0221d53498..bea2319d1ab 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/preprocessors/JspecifyMarksCleanupPreprocessor.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/preprocessors/JspecifyMarksCleanupPreprocessor.kt @@ -14,6 +14,6 @@ class JspecifyMarksCleanupPreprocessor(testServices: TestServices) : SourceFileP companion object { private val jspecifyMarks = diagnosticsToJspecifyMarks.values.map { it.values }.flatten().joinToString("|") - private val regexToCleanup = Regex("""[ ]*// ($jspecifyMarks)(, ($jspecifyMarks))*${System.lineSeparator()}""") + private val regexToCleanup = Regex("""[ ]*// ($jspecifyMarks)(, ($jspecifyMarks))*\n""") } } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractForeignAnnotationsTest.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractForeignAnnotationsTest.kt index b6efc9c354b..acc024adf9b 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractForeignAnnotationsTest.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractForeignAnnotationsTest.kt @@ -87,8 +87,8 @@ abstract class AbstractForeignAnnotationsTestBase : AbstractKotlinCompilerTest() } forTestsMatching("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/*") { -// useFrontendHandlers(::JspecifyDiagnosticComplianceHandler) -// useSourcePreprocessor(::JspecifyMarksCleanupPreprocessor) + useFrontendHandlers(::JspecifyDiagnosticComplianceHandler) + useSourcePreprocessor(::JspecifyMarksCleanupPreprocessor) } } } diff --git a/compiler/tests-compiler-utils/tests/org/jetbrains/kotlin/test/MockLibraryUtil.kt b/compiler/tests-compiler-utils/tests/org/jetbrains/kotlin/test/MockLibraryUtil.kt index ce4b662e83e..8db0a675674 100644 --- a/compiler/tests-compiler-utils/tests/org/jetbrains/kotlin/test/MockLibraryUtil.kt +++ b/compiler/tests-compiler-utils/tests/org/jetbrains/kotlin/test/MockLibraryUtil.kt @@ -121,7 +121,7 @@ object MockLibraryUtil { add("-d") add(classesDir.path) - if (useJava9) { + if (useJava9 && extraModulepath.isNotEmpty()) { add("--module-path") add(extraModulepath.joinToString(File.pathSeparator)) }