From 485035952a80a36355146394de8feab9d916b5df Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Mon, 8 Apr 2019 18:11:55 +0300 Subject: [PATCH] IR text tests: fix regex detection (like DUMP_EXTERNAL_CLASS) Before this commit, DUMP_EXTERNAL_CLASS etc. didn't work on Windows --- .../tests/org/jetbrains/kotlin/ir/AbstractIrTextTestCase.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractIrTextTestCase.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractIrTextTestCase.kt index 61974812292..006de95a05d 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractIrTextTestCase.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractIrTextTestCase.kt @@ -326,7 +326,7 @@ abstract class AbstractIrTextTestCase : AbstractIrGeneratorTestCase() { private val EXTERNAL_FILE_PATTERN = Regex("""// EXTERNAL_FILE""") private inline fun String.matchLinesWith(regex: Regex, ifMatched: (MatchResult) -> T): List = - split("\n").mapNotNull { regex.matchEntire(it)?.let(ifMatched) } + lines().mapNotNull { regex.matchEntire(it)?.let(ifMatched) } internal fun parseDumpExternalClasses(text: String) = text.matchLinesWith(DUMP_EXTERNAL_CLASS) { it.groupValues[1] }