Skip to content

Commit

Permalink
Fix compareCustom function in IrLineNumberTest class, to exclude comment
Browse files Browse the repository at this point in the history
lines that are not related for line number verification.

Unmute a test case should have been unmuted but shadowed by this bug.
  • Loading branch information
neetopia committed May 8, 2019
1 parent 8c83beb commit 2c5ebf3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 2c5ebf3

Please sign in to comment.