AbstractIntentionTest: should check startInWriteAction flag
This commit is contained in:
@@ -23,6 +23,7 @@ import com.intellij.testFramework.PlatformTestUtil
|
|||||||
import junit.framework.ComparisonFailure
|
import junit.framework.ComparisonFailure
|
||||||
import junit.framework.TestCase
|
import junit.framework.TestCase
|
||||||
import org.jetbrains.kotlin.idea.test.*
|
import org.jetbrains.kotlin.idea.test.*
|
||||||
|
import org.jetbrains.kotlin.idea.util.application.executeCommand
|
||||||
import org.jetbrains.kotlin.idea.util.application.executeWriteCommand
|
import org.jetbrains.kotlin.idea.util.application.executeWriteCommand
|
||||||
import org.jetbrains.kotlin.psi.KtFile
|
import org.jetbrains.kotlin.psi.KtFile
|
||||||
import org.jetbrains.kotlin.test.InTextDirectivesUtils
|
import org.jetbrains.kotlin.test.InTextDirectivesUtils
|
||||||
@@ -172,9 +173,12 @@ abstract class AbstractIntentionTest : KotlinLightCodeInsightFixtureTestCase() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (isApplicableExpected) {
|
if (isApplicableExpected) {
|
||||||
project.executeWriteCommand(intentionAction.text) {
|
val action = { intentionAction.invoke(project, editor, file) }
|
||||||
intentionAction.invoke(project, editor, file)
|
if (intentionAction.startInWriteAction())
|
||||||
}
|
project.executeWriteCommand(intentionAction.text, action)
|
||||||
|
else
|
||||||
|
project.executeCommand(intentionAction.text, null, action)
|
||||||
|
|
||||||
// Don't bother checking if it should have failed.
|
// Don't bother checking if it should have failed.
|
||||||
if (shouldFailString.isEmpty()) {
|
if (shouldFailString.isEmpty()) {
|
||||||
for ((filePath, value) in pathToFiles) {
|
for ((filePath, value) in pathToFiles) {
|
||||||
|
|||||||
Reference in New Issue
Block a user