diff --git a/idea/tests/org/jetbrains/kotlin/idea/codeInsight/surroundWith/AbstractSurroundWithTest.java b/idea/tests/org/jetbrains/kotlin/idea/codeInsight/surroundWith/AbstractSurroundWithTest.java index 10f129752fc..2c6cf4e52f4 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/codeInsight/surroundWith/AbstractSurroundWithTest.java +++ b/idea/tests/org/jetbrains/kotlin/idea/codeInsight/surroundWith/AbstractSurroundWithTest.java @@ -23,12 +23,14 @@ import com.intellij.lang.surroundWith.Surrounder; import com.intellij.openapi.editor.SelectionModel; import com.intellij.openapi.util.io.FileUtil; import com.intellij.psi.PsiElement; +import com.intellij.rt.execution.junit.FileComparisonFailure; import com.intellij.testFramework.LightCodeInsightTestCase; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.kotlin.idea.codeInsight.surroundWith.expression.*; import org.jetbrains.kotlin.idea.codeInsight.surroundWith.statement.*; import org.jetbrains.kotlin.test.InTextDirectivesUtils; +import org.jetbrains.kotlin.test.KotlinTestUtils; import java.io.File; import java.util.List; @@ -122,7 +124,14 @@ public abstract class AbstractSurroundWithTest extends LightCodeInsightTestCase private void invokeSurroundAndCheck(@NotNull String path, @NotNull Surrounder surrounder) { SurroundWithHandler.invoke(getProject(), getEditor(), getFile(), surrounder); - checkResultByFile(path + ".after"); + + String filePath = path + ".after"; + try { + checkResultByFile(filePath); + } + catch (FileComparisonFailure fileComparisonFailure) { + KotlinTestUtils.assertEqualsToFile(new File(filePath), getEditor()); + } } @Nullable