Fix testInGlobalPropertyWithGetter test in 173 branch
Workaround for IDEA-185462. It was introduced in 173 idea and fixed in 181.
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
// FALSE
|
// FALSE
|
||||||
|
// Important for 173 branch! OOCB is TRUE in this test because of IDEA-185462
|
||||||
|
|
||||||
class B(val a: A)
|
class B(val a: A)
|
||||||
val B.foo: Int
|
val B.foo: Int
|
||||||
get() {
|
get() {
|
||||||
|
|||||||
+11
-4
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.idea.codeInsight;
|
package org.jetbrains.kotlin.idea.codeInsight;
|
||||||
|
|
||||||
|
import com.intellij.ide.plugins.PluginManagerCore;
|
||||||
import com.intellij.openapi.application.ApplicationManager;
|
import com.intellij.openapi.application.ApplicationManager;
|
||||||
import com.intellij.openapi.util.io.FileUtil;
|
import com.intellij.openapi.util.io.FileUtil;
|
||||||
import com.intellij.openapi.util.text.StringUtil;
|
import com.intellij.openapi.util.text.StringUtil;
|
||||||
@@ -52,6 +53,16 @@ public abstract class AbstractOutOfBlockModificationTest extends KotlinLightCode
|
|||||||
myFixture.configureByFile(path);
|
myFixture.configureByFile(path);
|
||||||
|
|
||||||
boolean expectedOutOfBlock = getExpectedOutOfBlockResult();
|
boolean expectedOutOfBlock = getExpectedOutOfBlockResult();
|
||||||
|
boolean isSkipCheckDefined = InTextDirectivesUtils.isDirectiveDefined(myFixture.getFile().getText(), "SKIP_ANALYZE_CHECK");
|
||||||
|
|
||||||
|
if ("InGlobalPropertyWithGetter".equals(getTestName(false)) && PluginManagerCore.BUILD_NUMBER.contains("-173.")) {
|
||||||
|
expectedOutOfBlock = true;
|
||||||
|
isSkipCheckDefined = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
assertTrue("It's allowed to skip check with analyze only for tests where out-of-block is expected",
|
||||||
|
!isSkipCheckDefined || expectedOutOfBlock);
|
||||||
|
|
||||||
|
|
||||||
PsiModificationTrackerImpl tracker =
|
PsiModificationTrackerImpl tracker =
|
||||||
(PsiModificationTrackerImpl) PsiManager.getInstance(myFixture.getProject()).getModificationTracker();
|
(PsiModificationTrackerImpl) PsiManager.getInstance(myFixture.getProject()).getModificationTracker();
|
||||||
@@ -73,10 +84,6 @@ public abstract class AbstractOutOfBlockModificationTest extends KotlinLightCode
|
|||||||
assertEquals("Result for out of block test is differs from expected on element in file:\n" + FileUtil.loadFile(new File(path)),
|
assertEquals("Result for out of block test is differs from expected on element in file:\n" + FileUtil.loadFile(new File(path)),
|
||||||
expectedOutOfBlock, oobBeforeType != oobAfterCount);
|
expectedOutOfBlock, oobBeforeType != oobAfterCount);
|
||||||
|
|
||||||
boolean isSkipCheckDefined = InTextDirectivesUtils.isDirectiveDefined(myFixture.getFile().getText(), "SKIP_ANALYZE_CHECK");
|
|
||||||
assertTrue("It's allowed to skip check with analyze only for tests where out-of-block is expected",
|
|
||||||
!isSkipCheckDefined || expectedOutOfBlock);
|
|
||||||
|
|
||||||
if (!isSkipCheckDefined) {
|
if (!isSkipCheckDefined) {
|
||||||
checkOOBWithDescriptorsResolve(expectedOutOfBlock);
|
checkOOBWithDescriptorsResolve(expectedOutOfBlock);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user