diff --git a/compiler/ir/ir.tests/tests/org/jetbrains/kotlin/ir/AbstractIrTextTestCase.kt b/compiler/ir/ir.tests/tests/org/jetbrains/kotlin/ir/AbstractIrTextTestCase.kt index 3ace91cfedf..3267361bf10 100644 --- a/compiler/ir/ir.tests/tests/org/jetbrains/kotlin/ir/AbstractIrTextTestCase.kt +++ b/compiler/ir/ir.tests/tests/org/jetbrains/kotlin/ir/AbstractIrTextTestCase.kt @@ -41,10 +41,6 @@ abstract class AbstractIrTextTestCase : AbstractIrGeneratorTestCase() { val expectations = parseExpectations(dir, testFile) val irFileDump = irFile.dump() - expectations.irExpectedTextFile?.let { expectFile -> - KotlinTestUtils.assertEqualsToFile(expectFile, irFileDump) - } - val expected = StringBuilder() val actual = StringBuilder() for (expectation in expectations.regexps) { @@ -67,7 +63,7 @@ abstract class AbstractIrTextTestCase : AbstractIrGeneratorTestCase() { } } - internal class Expectations(val irExpectedTextFile: File?, val regexps: List, val irTreeFileLabels: List) + internal class Expectations(val regexps: List, val irTreeFileLabels: List) internal class RegexpInText(val numberOfOccurrences: Int, val needle: String) { constructor(countStr: String, needle: String) : this(Integer.valueOf(countStr), needle) @@ -77,11 +73,9 @@ abstract class AbstractIrTextTestCase : AbstractIrGeneratorTestCase() { companion object { private val EXPECTED_OCCURRENCES_PATTERN = Regex("""^\s*//\s*(\d+)\s*(.*)$""") - private val IR_FILE_TXT_PATTERN = Regex("""^\s*//\s*IR_FILE_TXT\s+(.*)$""") private val IR_TREES_TXT_PATTERN = Regex("""// \s*<<<\s+(.*)$""") internal fun parseExpectations(dir: File, testFile: TestFile): Expectations { - var expectedTextFileName: String? = null val regexps = ArrayList() val treeFiles = ArrayList() @@ -89,9 +83,6 @@ abstract class AbstractIrTextTestCase : AbstractIrGeneratorTestCase() { EXPECTED_OCCURRENCES_PATTERN.matchEntire(line)?.let { matchResult -> regexps.add(RegexpInText(matchResult.groupValues[1], matchResult.groupValues[2].trim())) } - ?: IR_FILE_TXT_PATTERN.matchEntire(line)?.let { matchResult -> - expectedTextFileName = matchResult.groupValues[1].trim() - } ?: IR_TREES_TXT_PATTERN.find(line)?.let { matchResult -> val fileName = matchResult.groupValues[1].trim() val file = createExpectedTextFile(testFile, dir, fileName) @@ -99,9 +90,7 @@ abstract class AbstractIrTextTestCase : AbstractIrGeneratorTestCase() { } } - val expectedTextFile: File? = expectedTextFileName?.let { createExpectedTextFile(testFile, dir, it) } - - return Expectations(expectedTextFile, regexps, treeFiles) + return Expectations(regexps, treeFiles) } internal fun createExpectedTextFile(testFile: TestFile, dir: File, fileName: String): File { diff --git a/compiler/testData/ir/irText/boxOk.kt b/compiler/testData/ir/irText/boxOk.kt index e958c5c4d63..5ad927f7853 100644 --- a/compiler/testData/ir/irText/boxOk.kt +++ b/compiler/testData/ir/irText/boxOk.kt @@ -1,3 +1,2 @@ +// <<< boxOk.txt fun box(): String = "OK" - -// IR_FILE_TXT boxOk.txt \ No newline at end of file diff --git a/compiler/testData/ir/irText/calls.kt b/compiler/testData/ir/irText/calls.kt index 7e1a5dfa12d..6b46c6c6d7f 100644 --- a/compiler/testData/ir/irText/calls.kt +++ b/compiler/testData/ir/irText/calls.kt @@ -1,8 +1,7 @@ +// <<< calls.txt fun foo(x: Int, y: Int) = x fun bar(x: Int) = foo(x, 1) fun qux(x: Int) = foo(foo(x, x), x) fun Int.ext1() = this fun Int.ext2(x: Int) = foo(this, x) - -// IR_FILE_TXT calls.txt \ No newline at end of file diff --git a/compiler/testData/ir/irText/dotQualified.kt b/compiler/testData/ir/irText/dotQualified.kt index 36752cd6240..47f5683f04d 100644 --- a/compiler/testData/ir/irText/dotQualified.kt +++ b/compiler/testData/ir/irText/dotQualified.kt @@ -1,4 +1,3 @@ +// <<< dotQualified.txt fun length(s: String) = s.length fun lengthN(s: String?) = s?.length - -// IR_FILE_TXT dotQualified.txt diff --git a/compiler/testData/ir/irText/extensionPropertyGetterCall.kt b/compiler/testData/ir/irText/extensionPropertyGetterCall.kt index 211bfa4934d..5b0ba320dbb 100644 --- a/compiler/testData/ir/irText/extensionPropertyGetterCall.kt +++ b/compiler/testData/ir/irText/extensionPropertyGetterCall.kt @@ -1,4 +1,3 @@ +// <<< extensionPropertyGetterCall.txt val String.okext: String get() = "OK" fun String.test5() = okext - -// IR_FILE_TXT extensionPropertyGetterCall.txt \ No newline at end of file diff --git a/compiler/testData/ir/irText/references.kt b/compiler/testData/ir/irText/references.kt index 6aa5c1244af..98591c22576 100644 --- a/compiler/testData/ir/irText/references.kt +++ b/compiler/testData/ir/irText/references.kt @@ -1,3 +1,4 @@ +// <<< references.txt val ok = "OK" val ok2 = ok val ok3: String get() = "OK" @@ -15,5 +16,3 @@ fun test4() = ok3 val String.okext: String get() = "OK" fun String.test5() = okext - -// IR_FILE_TXT references.txt \ No newline at end of file diff --git a/compiler/testData/ir/irText/smoke.kt b/compiler/testData/ir/irText/smoke.kt index 814098a54f1..bfdf6a1421a 100644 --- a/compiler/testData/ir/irText/smoke.kt +++ b/compiler/testData/ir/irText/smoke.kt @@ -1,3 +1,4 @@ +// <<< smoke.txt fun testFun(): String { return "OK" } val testSimpleVal = 1 // <<< smoke.testSimpleVal.txt val testValWithGetter: Int get() = 42 @@ -13,5 +14,3 @@ var testVarWithAccessors: Int // 1 IrPropertySetter // 1 IrProperty public var testSimpleVar // 1 IrProperty public var testVarWithAccessors - -// IR_FILE_TXT smoke.txt \ No newline at end of file