public class Test { public Boolean test() { return "true".equals("false"); } }
And I have a `HighlightVisitor`, now I am trying to test my `HighlightVisitor`, so I think that I need a text which contains the code I want to highlight and a editor (maybe?), and use my `HighlightVisitor` to highlight the editor and return the highlight result so that I could assert the result.
Easy.
<code>
void testMyHighlighter() {
assertEquals(4, new MyHighlightVisitor().computeTwoPlusTwo());
}
</code>
(you can also see
I mean, there are some code:
public class Test {public Boolean test() {
return "true".equals("false");
}
}
And I have a `HighlightVisitor`, now I am trying to test my `HighlightVisitor`, so I think that I need a text which contains the code I want to highlight and a editor (maybe?), and use my `HighlightVisitor` to highlight the editor and return the highlight result so that I could assert the result.
Already got it, by
myFixture.configureByText("dummy.java", code)PsiDocumentManager.getInstance(project).commitAllDocuments()
val doHighlighting = myFixture.doHighlighting()
Thanks