How can I test that custom intellij localinspectiontools produce the correct errors?

Answered

I have this code: https://gist.github.com/elarkin/db29bcfe35035f618dcb014db18b15cd

And when I debug the test, I expect that by the time fixture.doHighlights() returns my custom inspection gets called. Unfortunately I can't get any highlights to return nor can I get a breakpoint in the LocalInspectionTool to hit.

I'm *clearly* missing something obvious, but can't figure out what it is. Does anyone see it?

1 comment
Comment actions Permalink

Please consider ready-to-use baseclasses for such tests, e.g. BasePlatformTestCase.

The file to highlight should be configured in test method, not setup, and then use checkHighlighting()/testHighlighting()

Reference: https://plugins.jetbrains.com/docs/intellij/testing-highlighting.html

0

Please sign in to leave a comment.