RegExp: check highlighting in quickfix tests too

This commit is contained in:
Bas Leijdekkers
2017-02-09 14:39:45 +01:00
parent d5bf77bb62
commit b2f425f1cf
4 changed files with 4 additions and 3 deletions
@@ -24,7 +24,7 @@ import org.jetbrains.annotations.NotNull;
public class OctalEscapeInspectionTest extends RegExpInspectionTestCase {
public void testSimple() {
quickfixTest("\\011<caret>", "\\x09", "Replace with '\\x09'");
quickfixTest("<warning descr=\"Octal escape '\\011' in RegExp\">\\011</warning>", "\\x09", "Replace with '\\x09'");
}
@NotNull
@@ -42,6 +42,7 @@ public abstract class RegExpInspectionTestCase extends LightPlatformCodeInsightF
protected void quickfixTest(@Language("RegExp") String before, @Language("RegExp") String after, String hint) {
myFixture.enableInspections(getInspection());
myFixture.configureByText(RegExpFileType.INSTANCE, before);
myFixture.testHighlighting();
final IntentionAction intention = findIntention(hint);
assertNotNull(intention);
myFixture.launchAction(intention);
@@ -36,7 +36,7 @@ public class RepeatedSpaceInspectionTest extends RegExpInspectionTestCase {
}
public void testReplacement() {
quickfixTest(" ", " {5}", "Replace with ' {5}'");
quickfixTest("<warning descr=\"5 consecutive spaces in RegExp\"> </warning>", " {5}", "Replace with ' {5}'");
}
@Override
@@ -32,7 +32,7 @@ public class SingleCharAlternationInspectionTest extends RegExpInspectionTestCas
}
public void testQuickfix() {
quickfixTest("x|y|z", "[xyz]", "Replace with '[xyz]'");
quickfixTest("<warning descr=\"Single character alternation in RegExp\">x|y|z</warning>", "[xyz]", "Replace with '[xyz]'");
}
@NotNull