openSubAction.run();
// Check that the module editor opened with the right selection
moduleEditor = findEditor("EPICTest/lib/TestOpenSub.pm");
assertNotNull(moduleEditor);
ISelectionProvider provider = moduleEditor.getSelectionProvider();
ITextSelection selection = (ITextSelection) provider.getSelection();
assertEquals("some_sub", selection.getText());
assertEquals(
"sub some_sub #ok",
moduleEditor.getTestInterface().getText().substring(
selection.getOffset() - 4,
selection.getOffset() - 4 + "sub some_sub #ok".length()));
IDocument doc1 = editor.getViewer().getDocument();
appendText(doc1, "\n\nzzz();");
IDocument doc2 = moduleEditor.getViewer().getDocument();
appendText(doc2, "\n\nsub zzz { }");
testIface.selectText("zzz");
openSubAction.run();
selection = (ITextSelection) provider.getSelection();
assertEquals(
"sub zzz",
moduleEditor.getTestInterface().getText().substring(
selection.getOffset() - 4,
selection.getOffset() - 4 + "sub zzz".length()));