Custom language support: Testing annotation absence

Answered

Hey Team,

I'm trying to test the fact that, in a particular situation, my annotator does NOT produce an error annotation. Judging by ExpectedHighlightingData#checkResult(), only the expected annotation set items are checked for the presence in the produced highlight infos of the respective level, but not vice versa (i.e., the expected/actual highlight info sets need not be equal for a test to pass).

Is this intentional? Is there any way to actually test that a specific range does NOT get annotated?

Thanks!
Alexander

0
4 comments

You can provide corresponding test data for both positive/negative cases.

0

Thanks for your response Yann!

Could you perhaps point me to the docs, test examples or the IntelliJ test harness code (similar to ExpectedHighlightingData#checkResult) where the absence of an annotation is verified?

Regards,
Alexander

0

I'm not sure I understand your question - any mismatch of expected vs actual highlights (including missing ones) will be treated as test error.

0

Oh, sorry for overlooking! It was the "ignoreExtraHighlighting" parameter to the checkResult method, whose semantics I had mistaken for something else.

0

Please sign in to leave a comment.