[K2, CLI] Support endOffset in Kotlin CLI
Duplicated messages in testdata appeared because default renderer renders diagnostic spans ambiguously. It shows only start position. In fact, there are 3 failures, 2 of them distinguish only by the diagnostic end offset. See youtrack for more information. The issue about inconvenient rendering is KT-64989. #KT-64608
This commit is contained in:
committed by
Space Team
parent
6404cede07
commit
f05c972efb
+6
-2
@@ -11,6 +11,7 @@ import com.intellij.mock.MockProject
|
||||
import com.intellij.openapi.project.Project
|
||||
import org.jetbrains.kotlin.analyzer.AnalysisResult
|
||||
import org.jetbrains.kotlin.cli.common.CLITool
|
||||
import org.jetbrains.kotlin.cli.common.messages.MessageRenderer
|
||||
import org.jetbrains.kotlin.cli.js.K2JSCompiler
|
||||
import org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
|
||||
import org.jetbrains.kotlin.config.CompilerConfiguration
|
||||
@@ -60,7 +61,10 @@ class JsIrAnalysisHandlerExtensionTest : TestCaseWithTmpdir() {
|
||||
private val outklib: String
|
||||
get() = tmpdir.resolve("out.klib").absolutePath
|
||||
|
||||
private fun runTest(compiler: CLITool<*>, src: TestKtFile, libs: String, outFile: String, extras: List<String> = emptyList()) {
|
||||
private fun runTest(
|
||||
compiler: CLITool<*>, src: TestKtFile, libs: String, outFile: String, extras: List<String> = emptyList(),
|
||||
messageRenderer: MessageRenderer? = null,
|
||||
) {
|
||||
val mainKt = tmpdir.resolve(src.name).apply {
|
||||
writeText(src.content)
|
||||
}
|
||||
@@ -74,7 +78,7 @@ class JsIrAnalysisHandlerExtensionTest : TestCaseWithTmpdir() {
|
||||
"-language-version", "1.9",
|
||||
mainKt.absolutePath
|
||||
)
|
||||
CompilerTestUtil.executeCompilerAssertSuccessful(compiler, args + extras)
|
||||
CompilerTestUtil.executeCompilerAssertSuccessful(compiler, args + extras, messageRenderer)
|
||||
}
|
||||
|
||||
fun testShouldNotGenerateCodeJs() {
|
||||
|
||||
Reference in New Issue
Block a user