Add ability to test for expected intention text

If a testData file contains `// INTENTION_TEXT: ...`, the tested
intention's description must match `...`.
This commit is contained in:
Steven Allen
2014-02-27 14:42:58 -05:00
parent 8b88dff205
commit 162ed64706
@@ -170,6 +170,12 @@ public abstract class AbstractCodeTransformationTest extends LightCodeInsightTes
"isAvailable() for " + intentionAction.getClass() + " should return " + isApplicableExpected,
isApplicableExpected == intentionAction.isAvailable(getProject(), getEditor(), getFile()));
String intentionTextString = InTextDirectivesUtils.findStringWithPrefixes(fileText, "// INTENTION_TEXT: ");
if (intentionTextString != null) {
assertEquals("Intention text mismatch.", intentionTextString, intentionAction.getText());
}
String shouldFailString = InTextDirectivesUtils.findStringWithPrefixes(fileText, "// SHOULD_FAIL_WITH: ");
try {