Efficient doc string annotator; tests.

This commit is contained in:
Dmitry Cheryasov
2009-06-08 04:31:09 +04:00
parent 5825238679
commit 2cdd275589
5 changed files with 57 additions and 49 deletions

View File

@@ -11,6 +11,7 @@ import com.intellij.openapi.editor.markup.EffectType;
import java.awt.*;
/**
* Test highlighting added by annotators.
* @author yole
*/
public class PythonHighlightingTest extends DaemonAnalyzerTestCase {
@@ -39,6 +40,19 @@ public class PythonHighlightingTest extends DaemonAnalyzerTestCase {
doTest();
}
public void testDocStrings() throws Exception {
EditorColorsManager manager = EditorColorsManager.getInstance();
EditorColorsScheme scheme = (EditorColorsScheme)manager.getGlobalScheme().clone();
manager.addColorsScheme(scheme);
EditorColorsManager.getInstance().setGlobalScheme(scheme);
TextAttributesKey xKey = TextAttributesKey.find("PY.DOC_COMMENT");
TextAttributes xAttributes = new TextAttributes(Color.blue, Color.black, Color.white, EffectType.BOXED, Font.BOLD);
scheme.setAttributes(xKey, xAttributes);
doTest();
}
public void testReturnOutsideOfFunction() throws Exception {
doTest();
}