Diagnostic tests: don't create '.fir.kt' file if FIR_IDENTICAL

This commit is contained in:
Mikhail Glukhikh
2020-03-04 18:24:12 +03:00
parent 951fb0b7e7
commit 48d30daa47
@@ -280,8 +280,12 @@ abstract class AbstractDiagnosticsTest : BaseDiagnosticsTest() {
environment = this@AbstractDiagnosticsTest.environment
}
}
FileUtil.copy(testDataFile, firTestDataFile)
testRunner.analyzeAndCheckUnhandled(firTestDataFile, files)
if (testDataFile.readText().contains("// FIR_IDENTICAL")) {
testRunner.analyzeAndCheckUnhandled(testDataFile, files)
} else {
FileUtil.copy(testDataFile, firTestDataFile)
testRunner.analyzeAndCheckUnhandled(firTestDataFile, files)
}
}
private fun StringBuilder.cleanupInferenceDiagnostics(): String = replace(Regex("NI;([\\S]*), OI;\\1([,!])")) { it.groupValues[1] + it.groupValues[2] }