From 5acdc865b6d1674d82ff419e54ae41b40aba74b2 Mon Sep 17 00:00:00 2001 From: Vladimir Sukharev Date: Thu, 12 Oct 2023 12:34:21 +0200 Subject: [PATCH] Properly handle multi-line diagnostics test directives --- .../blackbox/support/util/ExternalSourcesTransformation.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/util/ExternalSourcesTransformation.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/util/ExternalSourcesTransformation.kt index e9059baa270..456e6dc1c38 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/util/ExternalSourcesTransformation.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/support/util/ExternalSourcesTransformation.kt @@ -5,6 +5,7 @@ package org.jetbrains.kotlin.konan.test.blackbox.support.util +import org.jetbrains.kotlin.codeMetaInfo.clearTextFromDiagnosticMarkup import org.jetbrains.kotlin.konan.test.blackbox.AbstractNativeCodegenBoxTest /** @@ -18,8 +19,7 @@ internal object DiagnosticsRemovingSourceTransformer : ExternalSourceTransformer override fun invoke(source: String) = source.lineSequence().joinToString("\n") { line -> // Remove all diagnostic parameters from the text. Examples: // , , . - line.replace(DIAGNOSTIC_REGEX) { match -> match.groupValues[1] } + // Removal must be done per source line, since doing it for whole file causes issues under Windows + clearTextFromDiagnosticMarkup(line) } - - private val DIAGNOSTIC_REGEX = Regex("(.*?)") }