From 83bae89ed8adf9ac223c2a566ce05365cafee639 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Mon, 19 Apr 2021 10:55:06 +0300 Subject: [PATCH] [Test] Show diff between fir file and testdata text if FE 1.0 and FIR test files don't match --- .../handlers/FirTestDataConsistencyHandler.kt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/FirTestDataConsistencyHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/FirTestDataConsistencyHandler.kt index 61d7c74e6ff..5ad9c2842d3 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/FirTestDataConsistencyHandler.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/FirTestDataConsistencyHandler.kt @@ -37,9 +37,15 @@ class FirTestDataConsistencyHandler(testServices: TestServices) : AfterAnalysisC originalFileContent = originalFileContent.replace("\r\n", "\n") firFileContent = firFileContent.replace("\r\n", "\n") } - testServices.assertions.assertEquals(originalFileContent, firFileContent) { - "Original and fir test data aren't identical. " + - "Please, add changes from ${testData.name} to ${firTestData.name}" + if (originalFileContent != firFileContent) { + testServices.assertions.assertEqualsToFile( + firTestData, + originalFileContent, + message = { + "Original and fir test data aren't identical. " + + "Please, add changes from ${testData.name} to ${firTestData.name}" + } + ) } }