How to carat position in plugin tests?
I'm trying to write a test for a plugin. This is the first time I've written a plugin test. At the moment I simply have:
public class MyPluginTest extends LightCodeInsightFixtureTestCase {
@NotNull
@Override
protected String getTestDataPath() {
return "src/test/resources";
}
public void testAddress() {
myFixture.configureByFile("input-code/AddressImpl.java");
int offset = myFixture.getEditor().getCaretModel().getOffset();
}
}
Despite the fact that I've put <carat> in the test input file, the carat offset is always 0.
I assume I'm missing another piece of configuration?
I've confirmed that the file path is correct as I get an error if it is incorrect.
I've verified that the carat returns a non-zero offset if I use configureByTest. e.g.
myFixture.configureByText("AddressImpl.java", "some dummy java code <carat> dummy code"
Thanks for any assistance.
Please sign in to leave a comment.
it must be <caret>, not <carat>
Doh! I see carat is the sort my wife is interested in....