Fix compareCustom function in IrLineNumberTest class, to exclude comment

lines that are not related for line number verification.

Unmute a test case should have been unmuted but shadowed by this bug.
This commit is contained in:
Jiaxiang Chen
2019-05-07 17:26:05 -07:00
parent 8c83beb086
commit 2c5ebf3ab2
2 changed files with 2 additions and 2 deletions
@@ -8,5 +8,5 @@ fun foo(i: Int = 1) {
inline fun bar(i: Int = 1) {
}
// IGNORE_BACKEND: JVM_IR
// 2 3 13 14 4 7 6 10 9 15
@@ -25,7 +25,7 @@ abstract class AbstractIrLineNumberTest : AbstractLineNumberTest() {
override fun compareCustom(psiFile: KtFile, wholeFile: File) {
val fileText = psiFile.text
val expectedLineNumbers = normalize(
fileText.substring(fileText.indexOf("//") + 2)
fileText.substring(Regex("// \\d+").find(fileText)!!.range.start + 2)
.trim().split(" ").map { it.trim() }.toMutableList()
)
val actualLineNumbers = normalize(extractActualLineNumbersFromBytecode(classFileFactory, false))