From 2c5ebf3ab28e86dc30c4036a6a773a3d1ed6f230 Mon Sep 17 00:00:00 2001 From: Jiaxiang Chen Date: Tue, 7 May 2019 17:26:05 -0700 Subject: [PATCH] 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. --- compiler/testData/lineNumber/custom/functionCallWithDefault.kt | 2 +- .../org/jetbrains/kotlin/codegen/ir/AbstractIrLineNumberTest.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/testData/lineNumber/custom/functionCallWithDefault.kt b/compiler/testData/lineNumber/custom/functionCallWithDefault.kt index f1a99034a0c..e7e155b002a 100644 --- a/compiler/testData/lineNumber/custom/functionCallWithDefault.kt +++ b/compiler/testData/lineNumber/custom/functionCallWithDefault.kt @@ -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 \ No newline at end of file diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractIrLineNumberTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractIrLineNumberTest.kt index 0e2472771dd..a01faa8259b 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractIrLineNumberTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractIrLineNumberTest.kt @@ -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))