How do I write a test that involves two editors?

I want to work on this issue: https://youtrack.jetbrains.com/issue/VIM-523#tab=Comments

I think I know how to fix the code, but I'm not sure how to write the test.  The CodeInsightTestFixture only contains one editor.  But I want to write a test that does something like this:

  1. Open file1 in editor1
  2. Put a bookmark1 in it
  3. Open file2 in editor2 and focus it
  4. Go to bookmark1
  5. check that file1 is open in editor1 and your cursor is in the correct place

Can someone show me how I would write such a test?

0
1 comment

You should be able to use use FileEditorManager.getSelectedTextEditor() to verify that the correct editor is currently active. Then you can use the caret model and selection model of that editor to verify that the caret is in the correct location.

0

Please sign in to leave a comment.