From 1b718761b282c1dee0c91d8e2756fd1ccd1ba4b6 Mon Sep 17 00:00:00 2001 From: Dmitry Gridin Date: Mon, 19 Aug 2019 19:27:35 +0700 Subject: [PATCH] AbstractQuickFixMultiModuleTest: support multiline errors `SHOULD_FAIL_WITH` --- .../idea/quickfix/AbstractQuickFixMultiModuleTest.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiModuleTest.kt b/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiModuleTest.kt index 042d434dc62..aecc791919f 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiModuleTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiModuleTest.kt @@ -44,14 +44,15 @@ abstract class AbstractQuickFixMultiModuleTest : AbstractMultiModuleTest(), Quic enableInspectionTools(*inspections) CommandProcessor.getInstance().executeCommand(project, { - var expectedErrorMessage: String = "" + var expectedErrorMessage = "" try { val actionHint = ActionHint.parse(actionFile, actionFileText) val text = actionHint.expectedText val actionShouldBeAvailable = actionHint.shouldPresent() - expectedErrorMessage = InTextDirectivesUtils.findStringWithPrefixes(actionFileText, "// SHOULD_FAIL_WITH: ") ?: "" + expectedErrorMessage = InTextDirectivesUtils.findListWithPrefixes(actionFileText, "// SHOULD_FAIL_WITH: ") + .joinToString(separator = "\n") AbstractQuickFixMultiFileTest.doAction( text, file, editor, actionShouldBeAvailable, actionFileName, this::availableActions, this::doHighlighting, @@ -87,7 +88,7 @@ abstract class AbstractQuickFixMultiModuleTest : AbstractMultiModuleTest(), Quic for (editedFile in project.allKotlinFiles()) { val afterFileInTmpProject = editedFile.containingDirectory?.findFile(editedFile.name + ".after") ?: continue - val afterFileInTestData = afterFiles.filter { it.name == afterFileInTmpProject.name } .single { + val afterFileInTestData = afterFiles.filter { it.name == afterFileInTmpProject.name }.single { it.readText() == File(afterFileInTmpProject.virtualFile.path).readText() }