IR text tests: fix regex detection (like DUMP_EXTERNAL_CLASS)

Before this commit, DUMP_EXTERNAL_CLASS etc. didn't work on Windows
This commit is contained in:
Mikhail Glukhikh
2019-04-08 18:11:55 +03:00
parent 61ae365cfd
commit 485035952a
@@ -326,7 +326,7 @@ abstract class AbstractIrTextTestCase : AbstractIrGeneratorTestCase() {
private val EXTERNAL_FILE_PATTERN = Regex("""// EXTERNAL_FILE""")
private inline fun <T> String.matchLinesWith(regex: Regex, ifMatched: (MatchResult) -> T): List<T> =
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] }