HighlightTest like Python?

Hi,
I want to write a testcase which checks the result of an Annotator, i.e. the applied highlighing.

I've found the Python test which does this: https://github.com/JetBrains/intellij-community/blob/210e0ed138627926e10094bb9c76026319cec178/python/testSrc/com/jetbrains/python/PythonHighlightingTest.java

I also found the file which contains the reference highlighting:
https://github.com/JetBrains/intellij-community/blob/210e0ed138627926e10094bb9c76026319cec178/python/testSrc/com/jetbrains/python/PythonHighlightingTest.java

Which part of the code removes the <info...> markers before the file is parsed?

I've found no way to remove them and the result (is of course) invalid code to the parser.

Thanks!
Wallaby

1 comment
Comment actions Permalink

Ok, found my own answer.
The documentation is at http://www.jetbrains.org/intellij/sdk/docs/basics/testing_plugins/testing_highlighting.html .
If the highlighting file contains invalid attributes, e.g. foreground="#ff0000" instead of foreground="0xff0000" then content is parsed and will result in parsing errors.

Also, you need to specify either all colors or none, if you remove on you will get an NPE.

0

Please sign in to leave a comment.