use of org.jetbrains.lang.manifest.highlighting.MisspelledHeaderInspection in project intellij-community by JetBrains.
the class MisspelledHeaderInspectionTest method testFix.
public void testFix() {
myFixture.enableInspections(new MisspelledHeaderInspection());
myFixture.configureByText(ManifestFileTypeFactory.MANIFEST, "ManifestVersion: 1.0\n");
List<IntentionAction> intentions = myFixture.filterAvailableIntentions("Change to");
assertEquals(1, intentions.size());
myFixture.launchAction(intentions.get(0));
myFixture.checkResult("Manifest-Version: 1.0\n");
}
use of org.jetbrains.lang.manifest.highlighting.MisspelledHeaderInspection in project intellij-community by JetBrains.
the class MisspelledHeaderInspectionTest method testCustomHeaderFix.
public void testCustomHeaderFix() {
MisspelledHeaderInspection inspection = new MisspelledHeaderInspection();
myFixture.enableInspections(inspection);
myFixture.configureByText(ManifestFileTypeFactory.MANIFEST, "Custom-Header: -\n");
List<IntentionAction> intentions = myFixture.filterAvailableIntentions("Add ");
assertEquals(1, intentions.size());
myFixture.launchAction(intentions.get(0));
assertEquals(Collections.singleton("Custom-Header"), inspection.CUSTOM_HEADERS);
}
use of org.jetbrains.lang.manifest.highlighting.MisspelledHeaderInspection in project intellij-community by JetBrains.
the class MisspelledHeaderInspectionTest method doTest.
private void doTest(String text, int expected) {
myFixture.enableInspections(new MisspelledHeaderInspection());
myFixture.configureByText(ManifestFileTypeFactory.MANIFEST, text + "\n");
myFixture.checkHighlighting();
assertEquals(expected, myFixture.filterAvailableIntentions("Change to").size());
}
use of org.jetbrains.lang.manifest.highlighting.MisspelledHeaderInspection in project intellij-community by JetBrains.
the class MisspelledHeaderInspectionTest method testCustomHeader.
public void testCustomHeader() {
MisspelledHeaderInspection inspection = new MisspelledHeaderInspection();
inspection.CUSTOM_HEADERS.add("Custom-Header");
myFixture.enableInspections(inspection);
myFixture.configureByText(ManifestFileTypeFactory.MANIFEST, "Custom-Header: -\n");
myFixture.checkHighlighting();
}
Aggregations