Skip to content

Commit d24d750

Browse files
Evgeny GerashchenkoEvgeny Gerashchenko
authored andcommitted
Added workaround for bug in IDEA test framework. Without it, tests didn't make much sense.
1 parent 33e34c7 commit d24d750

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

idea/tests/org/jetbrains/kotlin/idea/codeInsight/AbstractLineMarkersTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.intellij.openapi.editor.Document;
2323
import com.intellij.openapi.project.Project;
2424
import com.intellij.openapi.util.Condition;
25+
import com.intellij.openapi.util.io.FileUtil;
2526
import com.intellij.psi.NavigatablePsiElement;
2627
import com.intellij.psi.PsiDocumentManager;
2728
import com.intellij.psi.PsiElement;
@@ -80,6 +81,12 @@ public void doTest(String path) {
8081

8182
try {
8283
data.checkLineMarkers(markers, document.getText());
84+
85+
// This is a workaround for sad bug in ExpectedHighlightingData:
86+
// the latter doesn't throw assertion error when some line markers are expected, but none are present.
87+
if (FileUtil.loadFile(new File(path)).contains("<lineMarker") && markers.isEmpty()) {
88+
throw new AssertionError("Some line markers are expected, but nothing is present at all");
89+
}
8390
}
8491
catch (AssertionError error) {
8592
try {

0 commit comments

Comments
 (0)